Skip to content

Commit 335e377

Browse files
committed
add query syntax with `simple_query_string
1 parent e48e52e commit 335e377

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

share/search/index_strategy/trovesearch_denorm.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -719,12 +719,13 @@ def _text_field_name(self, propertypath: Propertypath):
719719
)
720720

721721
def _exact_text_query(self, textsegment: Textsegment) -> dict:
722-
# TODO: textsegment.is_openended (prefix query)
723-
return _any_query([
724-
{'match_phrase': {self._text_field_name(_path): {'query': textsegment.text}}}
725-
for _path in textsegment.propertypath_set
726-
])
727-
722+
return {
723+
"simple_query_string": {
724+
"query": textsegment.text,
725+
"fields": [self._text_field_name(_path) for _path in textsegment.propertypath_set],
726+
"default_operator": "AND"
727+
}
728+
}
728729
def _fuzzy_text_must_query(self, textsegment: Textsegment) -> dict:
729730
# TODO: textsegment.is_openended (prefix query)
730731
return _any_query([

0 commit comments

Comments
 (0)