From 42cbaf0314ba209785474f22b3706a202ebb32a6 Mon Sep 17 00:00:00 2001 From: Vladimir G Date: Wed, 12 Jul 2023 14:02:47 -0400 Subject: [PATCH] DUG-155 Consistently incorrect concept counts in some cases --- src/dug/core/async_search.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/dug/core/async_search.py b/src/dug/core/async_search.py index 15c52043..17743192 100644 --- a/src/dug/core/async_search.py +++ b/src/dug/core/async_search.py @@ -97,6 +97,14 @@ async def search_concepts(self, query, offset=0, size=None, fuzziness=1, prefix_ """ query = { "bool": { + "filter": { + "bool": { + "must": [ + {"wildcard": {"description": "?*"}}, + {"wildcard": {"name": "?*"}} + ] + } + }, "should": [ { "match_phrase": { @@ -184,7 +192,8 @@ async def search_concepts(self, query, offset=0, size=None, fuzziness=1, prefix_ } } } - ] + ], + "minimum_should_match": 1, } } body = json.dumps({'query': query})