Answer the question
In order to leave comments, you need to log in
How to search all words in a field in elasticsearch?
I have such a problem, for example, I have the text "hello world" and I need to return those documents in which there are 2 words and not "hello" or "world"
Answer the question
In order to leave comments, you need to log in
This is implemented using phrase search :
GET /megacorp/employee/_search
{
"query" : {
"match_phrase" : {
"some_field" : "hello world"
}
}
}
{
"match" : {
"message" : {
"query" : "hello world",
"operator" : "and"
}
}
}
the answer from un1t searches for words throughout the text, regardless of their location, the main thing is that they are, and if analyzers with morphology, then there will also be word forms to look for
recently did to search for a phrase but with word forms, asked the question
How to search for phrases in elasticsearch with fuzzy?
applies only to such a configuration of analyzers as in the question, you need to test for another
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question