diff options
author | bobzel <zzzman@gmail.com> | 2020-09-01 17:43:59 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2020-09-01 17:43:59 -0400 |
commit | 25d8d43425785038a74acbc9be618b70f48bbba0 (patch) | |
tree | 25bd1dde9b13b113a7738a34d6f4dd5aace5e4c6 /src/client/util/SearchUtil.ts | |
parent | 4bdb3b64c476ffdc5b5c53c9c296c50ce68a8fc5 (diff) |
fixed search bar getting stuck open. fixed search for fields in full db.
Diffstat (limited to 'src/client/util/SearchUtil.ts')
-rw-r--r-- | src/client/util/SearchUtil.ts | 3 |
1 files changed, 2 insertions, 1 deletions
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); |