Using ES 5.1.1 (Edit: Just upgraded to 5.5.0, same behaviour)
I'm getting some odd behaviour when mixing minimum_should_match with differing analyzers, and was wondering if anyone had any insights.
Simplified down, my issue is this:
I have two analysers. One has stopwords (A), and one doesn't(B).
There are two fields.
"title", which uses analyser A (the one with stopwords)
"keywords", which uses analyser B.
The stopwords list includes the word "cat".
There is one record:
{"title": "Hello world", "keywords": "dog"}
I'm doing the following query:
"query" : {
"multi_match": {
"query" : "hello cat",
"type" : "cross_fields",
"fields": ["title", "keywords"],
"minimum_should_match" : 2
}
}
Now, in theory there should be no results. The word "cat" doesn't appear anywhere in the data, and minimum_should_match is set to 2. Yet this result is returned.
If I change the query term to:
"hello cheese", I rightly get 0 results.
Does anyone know why is this? Any suggestions on how can I work around it to get the desired result would be appreciated?
Thanks