What is the importance of the token position to scoring? I'd expect when the token matches that a token in position 1 to be returned higher in the results than the token in position 2.
I've an index with orange coconut apple coconut orange apple coconut apple orange coconut red orange
Search for the word "coconut" with a match query.
It is returned in these positions 1 orange coconut apple 2 coconut red orange 3 coconut orange apple 4 coconut apple orange
I'd expect to see orange coconut apple returned 4th.
Why is this occurring and what may be the solution/setting I'm missing?
Thanks
PUT name
{
"template": "name*",
"mappings": {
"name": {
"_all": {
"enabled": false
},
"properties": {
"name": {
"type": "text",
"analyzer": "standard"
}
}
}
}
}
PUT name/name/1
{
"name" : "orange coconut apple"
}
PUT name/name/2
{
"name" : "coconut orange apple"
}
PUT name/name/3
{
"name" : "coconut red orange"
}
PUT name/name/4
{
"name" : "coconut apple orange"
}
GET name/_search
{
"query": {
"match" : { "name" : "coconut" }
}
}