From 544577e1bc1611c8de1863d2a78458808ea05851 Mon Sep 17 00:00:00 2001 From: bobzel Date: Mon, 28 Sep 2020 03:45:57 +0000 Subject: fixed syntax for SOLR --- src/client/util/SearchUtil.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/client/util/SearchUtil.ts b/src/client/util/SearchUtil.ts index b09eff849..84470f073 100644 --- a/src/client/util/SearchUtil.ts +++ b/src/client/util/SearchUtil.ts @@ -42,8 +42,9 @@ export namespace SearchUtil { let replacedQuery = query.replace(/type_t:([^ )])/g, (substring, arg) => `{!join from=id to=proto_i}*:* AND ${arg}`); if (options.onlyAliases) { const header = query.match(/_[atnb]?:/) ? replacedQuery : "DEFAULT:" + replacedQuery; - replacedQuery = `{!join from=id to=proto_i}${header}`; + replacedQuery = `({!join from=id to=proto_i}*) AND ${header}`; } + console.log("Q: " + replacedQuery); const gotten = await rp.get(rpquery, { qs: { ...options, q: replacedQuery } }); const result: IdSearchResult = gotten.startsWith("<") ? { ids: [], docs: [], numFound: 0, lines: [] } : JSON.parse(gotten); if (!returnDocs) { -- cgit v1.2.3-70-g09d2