Skip to content

Commit 2d3d565

Browse files
committed
simplified
1 parent d41a15a commit 2d3d565

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

share/search/index_strategy/trovesearch_denorm.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,16 @@ def iri_boolparts(self) -> Iterator[tuple[str, dict]]:
654654
def text_boolparts(self) -> Iterator[tuple[str, dict]]:
655655
# text-based queries
656656
for _text in self.searchtext:
657-
yield 'must', self._exact_text_query(_text)
657+
yield (
658+
'must',
659+
{
660+
"simple_query_string": {
661+
"query": _text.text,
662+
"fields": [self._text_field_name(_path) for _path in _text.propertypath_set],
663+
"default_operator": "AND"
664+
}
665+
}
666+
)
658667

659668
def _presence_query(self, search_filter) -> dict:
660669
return _any_query([
@@ -711,16 +720,6 @@ def _text_field_name(self, propertypath: Propertypath):
711720
else f'{self.base_field}.text_by_propertypath.{_path_field_name(propertypath)}'
712721
)
713722

714-
def _exact_text_query(self, textsegment: SearchText) -> dict:
715-
return {
716-
"simple_query_string": {
717-
"query": textsegment.text,
718-
"fields": [self._text_field_name(_path) for _path in textsegment.propertypath_set],
719-
"default_operator": "AND"
720-
}
721-
}
722-
723-
724723
@dataclasses.dataclass
725724
class _CardsearchQueryBuilder:
726725
params: CardsearchParams

0 commit comments

Comments
 (0)