diff options
author | anika-ahluwalia <anika.ahluwalia@gmail.com> | 2020-08-12 18:03:59 -0500 |
---|---|---|
committer | anika-ahluwalia <anika.ahluwalia@gmail.com> | 2020-08-12 18:03:59 -0500 |
commit | 284da73b9de8d51fa7c43739c338677b5ee9ba87 (patch) | |
tree | 46d9be5e96142d7b95c4310e4d60baf7d0bdabca /src/client/util/SearchUtil.ts | |
parent | 7a4a42dae14e0da1a026c2717c5183fa96a9e990 (diff) | |
parent | bb74db76c4cf694c646a3f248fa8151f15d8020e (diff) |
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into menu_restructure
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; |