From 4ed8daf3bcceb8dec07d349e2da584005d4f17d5 Mon Sep 17 00:00:00 2001 From: Andy Rickert Date: Wed, 20 May 2020 21:52:52 -0700 Subject: working on search syntax --- src/client/util/SearchUtil.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src') 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; export function Search(query: string, returnDocs: false, options?: SearchParams): Promise; 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; } -- cgit v1.2.3-70-g09d2