Match_phrase with a fixed word sequence?


Hi there, when I try to use "match_phrase" and "slop" to query a phrase, the sequence of words is not fixed, for example, if I search "quick fox" with slop 2, it will match either "quick brown fox" or "fox brown quick", but I only wanna "quick brown fox" as my result is there any solution for making the words sequence fixed when I searching a phrase? thanks!

(Nik Everett) #2

There is a query in lucene like this but it isn't exposed to elasticsearch:

You could try a slop of 1 but I don't think that is what you want.


Thanks for the quick reply! I will take a look about this lucene are right, slop 1 is not what I need, and even use slop 1, the sequence also is not fixed..

(system) #4