Answer the question
In order to leave comments, you need to log in
Search by part of the city or How to create an analyzer for cities?
I'm doing a city search.
The first field is name for example: СНТ Москва
The second field is text in detail, for example:
Россия, Московская область, Орехово-Зуевский район, СНТ Москва
'query' => [
'query_string' => [
'query' => $q,
'boost' => 1,
'phrase_slop' => 2,
'fields' => [
'name^3',
'text^2',
],
'default_operator' => 'and',
]
],
'sort' => [
'_score' => [
'order' => 'desc'
]
]
'query' => '*'.$q.'*',
'query' => $q',
Moscow is in the first place, as it should. Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question