From 25d8d43425785038a74acbc9be618b70f48bbba0 Mon Sep 17 00:00:00 2001 From: bobzel Date: Tue, 1 Sep 2020 17:43:59 -0400 Subject: fixed search bar getting stuck open. fixed search for fields in full db. --- src/client/util/SearchUtil.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/client/util') diff --git a/src/client/util/SearchUtil.ts b/src/client/util/SearchUtil.ts index afa8ff575..b34acce27 100644 --- a/src/client/util/SearchUtil.ts +++ b/src/client/util/SearchUtil.ts @@ -41,7 +41,8 @@ export namespace SearchUtil { const rpquery = Utils.prepend("/dashsearch"); let replacedQuery = query.replace(/type_t:([^ )])/g, (substring, arg) => `{!join from=id to=proto_i}type_t:${arg}`); if (options.onlyAliases) { - replacedQuery = `{!join from=id to=proto_i}DEFAULT:${replacedQuery}`; + const header = query.match(/_[atnb]?:/) ? replacedQuery : "DEFAULT:" + replacedQuery; + replacedQuery = `{!join from=id to=proto_i}${header}`; } const gotten = await rp.get(rpquery, { qs: { ...options, q: replacedQuery } }); const result: IdSearchResult = gotten.startsWith("<") ? { ids: [], docs: [], numFound: 0, lines: [] } : JSON.parse(gotten); -- cgit v1.2.3-70-g09d2