The scores between Elasticsearch 2.x and 5.x seem to be different for the same indexed data with the same mapping and same query.
Using:
PUT test
{
"settings" : {
"number_of_shards" : 1
},
"mappings" : {
"type1" : {
"properties" : {
"field1" : { "type" : "string" }
}
}
}
}
PUT /test/type1/1
{
"field1": "My first blog entry"
}
POST test/_search
{
"query": {
"match" : {
"field1" : "blog"
}
}
}
The results on 2.4.3 are
{
"took": 1,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"failed": 0
},
"hits": {
"total": 1,
"max_score": 0.2876821,
"hits": [
{
"_index": "test",
"_type": "type1",
"_id": "1",
"_score": 0.2876821,
"_source": {
"field1": "My first blog entry"
}
}
]
}
}
The results on 5.1.1 are
{
"took": 1,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"failed": 0
},
"hits": {
"total": 1,
"max_score": 0.15342641,
"hits": [
{
"_index": "test",
"_type": "type1",
"_id": "1",
"_score": 0.15342641,
"_source": {
"field1": "My first blog entry"
}
}
]
}
}
Is this the expected behavior?
And wouldn't a different scoring algorithm have unexpected results when using queries with boosts made in 2.x?