Apparently, match_phrase is a solution but according to this article this is not the case:
You understanding is correct. The former will be translated into a Lucene
phrase query, which uses the term doc positions to find matches.
Both query terms are analyzed, but the latter will simply be a bag-of-words
query, which ignores positions.
Cheers,
Ivan
On Apr 14, 2015 10:38 PM, "Dave Reed" infinity88@gmail.com wrote:
To perhaps answer my own question, I think I understand the difference.
details:"foo bar"
Would search for the tokens in the same order (implied by the docs I
ref…
body = {
"query": {
"multi_match" : {
"query": "word1 word2",
"fields": ["data"],
"type": "phrase",
"slop": 9999
}
}
}
Just tried this, can confirm, that it gives same results regardless of order of words considered.