diff options
| author | bobzel <zzzman@gmail.com> | 2020-08-12 13:16:58 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-12 13:16:58 -0400 |
| commit | f9c189d6a602e0b0d9f342e72aed70bd894efe5e (patch) | |
| tree | 3563fa6bd5fac3141e497f8b0d532f0af2783e08 /src/client/util | |
| parent | c38249e8df315272783cf95439e62b4871a42502 (diff) | |
| parent | e5e693d7699e34d20fb183bc2514557edfb7d0f7 (diff) | |
Merge pull request #564 from browngraphicslab/schema_search
Schema search
Diffstat (limited to 'src/client/util')
| -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; |
