diff options
author | Tyler Schicke <tyler_schicke@brown.edu> | 2019-07-17 20:48:14 -0400 |
---|---|---|
committer | Tyler Schicke <tyler_schicke@brown.edu> | 2019-07-17 20:48:14 -0400 |
commit | 5aa6bcdd4e23bb9e9d05181d0dc6b638e45e397b (patch) | |
tree | 1929cc92dd43d9e48d0e7dbe5649721ba9bba906 /src/client/util/SearchUtil.ts | |
parent | ea5b91c45baba7be50a5e2276f9b3618af634676 (diff) |
Moved DocServer.prepend and changed how corsProxy works
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 abf1a7c32..ee5a83710 100644 --- a/src/client/util/SearchUtil.ts +++ b/src/client/util/SearchUtil.ts @@ -2,6 +2,7 @@ import * as rp from 'request-promise'; import { DocServer } from '../DocServer'; import { Doc } from '../../new_fields/Doc'; import { Id } from '../../new_fields/FieldSymbols'; +import { Utils } from '../../Utils'; export namespace SearchUtil { export type HighlightingResult = { [id: string]: { [key: string]: string[] } }; @@ -29,7 +30,7 @@ export namespace SearchUtil { 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 result: IdSearchResult = JSON.parse(await rp.get(DocServer.prepend("/search"), { + const result: IdSearchResult = JSON.parse(await rp.get(Utils.prepend("/search"), { qs: { ...options, q: query }, })); if (!returnDocs) { |