Hello everyone,
I have a problem with the following query:
{
"query": {
"span_near": {
"clauses": [
{
"span_near": {
"clauses": [
{ "span_term": { "text1": "word1" } },
{ "span_term": { "text1": "word2" } },
],
"slop": 0,
"in_order": true
}
},
{ "span_term": { "text1": "word3" } }
],
"slop": 3,
"in_order": false
}
}
}
I want to search with [word1 word2] next to each other while [word3] is at slop distance from the other two.
The above query returns 1 document that matches the criteria. If i increase the outer slop, the document is returned but this is not the correct behaviour. The distance between the inner block of [word1 word2] is 3 words away from the word3. Why it matches the documents?
If i decrease the slop, does not match any document (correct behaviour).
The analyzer i use for the text field is the greek one.
Thanks in advance for any advice.