Sample doc
{
"id": 5,
"title": "Quick Brown fox jumps over the lazy dog",
"genre": [
"fiction"
]
}
Mapping
{
"movies" : {
"mappings" : {
"properties" : {
"genre" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"id" : {
"type" : "long"
},
"title" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
}
}
}
}
}
Query1: Results in the document shared earlier
{
"query": {
"match_phrase": {
"title": {
"query": "fox quick over", "slop": 3
}
}
}
}
Query2: No Results
{
"query": {
"match_phrase": {
"title": {
"query": "over fox quick", "slop": 3
}
}
}
}
I was expecting a result in query2 rather than in query 1.