diff options
Diffstat (limited to 'src/server/Search.ts')
| -rw-r--r-- | src/server/Search.ts | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/server/Search.ts b/src/server/Search.ts index c3cb3c3e6..5ca5578a7 100644 --- a/src/server/Search.ts +++ b/src/server/Search.ts @@ -8,18 +8,22 @@ export class Search { public async updateDocument(document: any) { try { - return await rp.post(this.url + "dash/update", { + const res = await rp.post(this.url + "dash/update", { headers: { 'content-type': 'application/json' }, body: JSON.stringify([document]) }); - } catch { } + return res; + } catch (e) { + console.warn("Search error: " + e + document); + } } public async search(query: string) { try { const searchResults = JSON.parse(await rp.get(this.url + "dash/select", { qs: { - q: query + q: query, + fl: "id" } })); const fields = searchResults.response.docs; |
