diff options
| author | bobzel <zzzman@gmail.com> | 2020-08-13 07:59:09 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2020-08-13 07:59:09 -0400 |
| commit | 75dc5eb094bbac18310d4be49529743eb051789c (patch) | |
| tree | c8b06e73b075f6a9c58f824a50036948b18b23c7 /src/client/util/SearchUtil.ts | |
| parent | 2583d4cd4b8a5f8b3acc3c0e0970adf295d4d8c5 (diff) | |
| parent | 2d3f72210df626f099379f2f2c6e47fb1d415d82 (diff) | |
Merge branch 'master' into acls_uv
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 7b2c601fe..3073da954 100644 --- a/src/client/util/SearchUtil.ts +++ b/src/client/util/SearchUtil.ts @@ -37,7 +37,8 @@ export namespace SearchUtil { export async function Search(query: string, returnDocs: boolean, options: SearchParams = {}) { query = query || "*"; //If we just have a filter query, search for * as the query const rpquery = Utils.prepend("/dashsearch"); - const gotten = await rp.get(rpquery, { qs: { ...options, q: query } }); + const replacedQuery = query.replace(/type_t:([^ )])/, (substring, arg) => `{!join from=id to=proto_i}type_t:${arg}`); + const gotten = await rp.get(rpquery, { qs: { ...options, q: replacedQuery } }); const result: IdSearchResult = gotten.startsWith("<") ? { ids: [], docs: [], numFound: 0, lines: [] } : JSON.parse(gotten); if (!returnDocs) { return result; |
