diff options
author | Andy Rickert <andrew_rickert@brown.edu> | 2020-05-20 21:52:52 -0700 |
---|---|---|
committer | Andy Rickert <andrew_rickert@brown.edu> | 2020-05-20 21:52:52 -0700 |
commit | 4ed8daf3bcceb8dec07d349e2da584005d4f17d5 (patch) | |
tree | 20c82393be94ad9a53c5adf5613c19262c96394b | |
parent | 0f27d979e01c58d87f1800d7e38e41de2a2e037e (diff) |
working on search syntax
-rw-r--r-- | src/client/util/SearchUtil.ts | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/client/util/SearchUtil.ts b/src/client/util/SearchUtil.ts index c2be385ae..1939b3e77 100644 --- a/src/client/util/SearchUtil.ts +++ b/src/client/util/SearchUtil.ts @@ -29,16 +29,21 @@ export namespace SearchUtil { rows?: number; fq?: string; allowAliases?: boolean; + } export function Search(query: string, returnDocs: true, options?: SearchParams): Promise<DocSearchResult>; export function Search(query: string, returnDocs: false, options?: SearchParams): Promise<IdSearchResult>; 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"); - console.log(query); - const gotten = await rp.get(rpquery, { qs: { ...options, q: query } }); + console.log(rpquery); + console.log(options); + query = query + '&facet=true&facet.field=_height&facet.limit=3'; + const gotten = await rp.get(rpquery+) + // const gotten = await rp.get(rpquery, { qs: { ...options, q: query } }); console.log(gotten); const result: IdSearchResult = gotten.startsWith("<") ? { ids: [], docs: [], numFound: 0, lines: [] } : JSON.parse(gotten); + console.log(result); if (!returnDocs) { return result; } |