Answer the question
In order to leave comments, you need to log in
How to properly map or write a query?
I have products with names consisting of 1-5 words. You need to search by product name.
Example. There are products with names.
Brown slippers
Green slippers
Green stealths
Green tanks
When user enters “tapo”
must be given away
Brown slippers
Green slippers
when typing “green”
Green slippers
Green stealths
Green tanks
All this currently works when mapping the title field: {type: text, boost: 5 }
and request
{"query":{
"bool":{
"must":[{
"prefix":{"title":{"value":"зел"}
}
}]
}}
}
Answer the question
In order to leave comments, you need to log in
Break terms into ngram https://www.elastic.co/guide/en/elasticsearch/guid...
Another point, the current request is solved by a rather simple match_phrase_prefix operator
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question