diff options
| author | Stanley Yip <stanley_yip@brown.edu> | 2020-01-17 15:45:05 -0500 |
|---|---|---|
| committer | Stanley Yip <stanley_yip@brown.edu> | 2020-01-17 15:45:05 -0500 |
| commit | 8667498929fce14295658f89c8787a1a9b1ce468 (patch) | |
| tree | c3d03768bf2b8d23e438479c67141fae43c63e1e /src/server/Search.ts | |
| parent | 4b0a056f1afaf20dea4be64c7b238748d99ad12e (diff) | |
| parent | 9620d149a2051bc9b42a037b1c65b61deebd11fa (diff) | |
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into pen
Diffstat (limited to 'src/server/Search.ts')
| -rw-r--r-- | src/server/Search.ts | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/server/Search.ts b/src/server/Search.ts index 2b59c14b1..21064e520 100644 --- a/src/server/Search.ts +++ b/src/server/Search.ts @@ -1,4 +1,5 @@ import * as rp from 'request-promise'; +import { red } from 'colors'; const pathTo = (relative: string) => `http://localhost:8983/solr/dash/${relative}`; @@ -43,7 +44,7 @@ export namespace Search { export async function clear() { try { - return rp.post(pathTo("update"), { + await rp.post(pathTo("update"), { body: { delete: { query: "*:*" @@ -51,7 +52,10 @@ export namespace Search { }, json: true }); - } catch { } + } catch (e) { + console.log(red("Unable to clear search...")); + console.log(red(e.message)); + } } export async function deleteDocuments(docs: string[]) { |
