diff --git a/share/search/index_strategy/trovesearch_denorm.py b/share/search/index_strategy/trovesearch_denorm.py index 1d13bc33e..a65eb776f 100644 --- a/share/search/index_strategy/trovesearch_denorm.py +++ b/share/search/index_strategy/trovesearch_denorm.py @@ -654,7 +654,16 @@ def iri_boolparts(self) -> Iterator[tuple[str, dict]]: def text_boolparts(self) -> Iterator[tuple[str, dict]]: # text-based queries for _text in self.searchtext: - yield 'must', self._exact_text_query(_text) + yield ( + 'must', + { + "simple_query_string": { + "query": _text.text, + "fields": [self._text_field_name(_path) for _path in _text.propertypath_set], + "default_operator": "AND" + } + } + ) def _presence_query(self, search_filter) -> dict: return _any_query([ @@ -711,13 +720,6 @@ def _text_field_name(self, propertypath: Propertypath): else f'{self.base_field}.text_by_propertypath.{_path_field_name(propertypath)}' ) - def _exact_text_query(self, textsegment: SearchText) -> dict: - # TODO: textsegment.is_openended (prefix query) - return _any_query([ - {'match_phrase': {self._text_field_name(_path): {'query': textsegment.text}}} - for _path in textsegment.propertypath_set - ]) - @dataclasses.dataclass class _CardsearchQueryBuilder: