Если вы добавите параметр explain:true
, вы увидите, что вы превышаете максимальное значение для оценки, поэтому все они в конечном итоге одинаковы.
"hits": {
"total": 2,
"max_score": 1545536930000,
"hits": [
{
"_shard": "[test1][2]",
"_node": "L0mg3oZdRdSSlah6QPVqjQ",
"_index": "test1",
"_type": "doc",
"_id": "2",
"_score": 1545536930000,
"_source": {
"createdAt": 1545536877422,
"firstName": "foo2"
},
"_explanation": {
"value": 1545536930000,
"description": "function score, product of:",
"details": [
{
"value": 1,
"description": "*:*, product of:",
"details": [
{
"value": 1,
"description": "boost",
"details": []
},
{
"value": 1,
"description": "queryNorm",
"details": []
}
]
},
{
"value": 1545536930000,
"description": "min of:",
"details": [
{
"value": 1545536930000,
"description": "field value function: none(doc['createdAt'].value * factor=1.0)",
"details": []
},
{
"value": 3.4028235e+38,
"description": "maxBoost",
"details": []
}
]
}
]
}
},
{
"_shard": "[test1][3]",
"_node": "L0mg3oZdRdSSlah6QPVqjQ",
"_index": "test1",
"_type": "doc",
"_id": "1",
"_score": 1545536930000,
"_source": {
"createdAt": 1545536877421,
"firstName": "foo1"
},
"_explanation": {
"value": 1545536930000,
"description": "function score, product of:",
"details": [
{
"value": 1,
"description": "*:*, product of:",
"details": [
{
"value": 1,
"description": "boost",
"details": []
},
{
"value": 1,
"description": "queryNorm",
"details": []
}
]
},
{
"value": 1545536930000,
"description": "min of:",
"details": [
{
"value": 1545536930000,
"description": "field value function: none(doc['createdAt'].value * factor=1.0)",
"details": []
},
{
"value": 3.4028235e+38,
"description": "maxBoost",
"details": []
}
]
}
]
}
}
]
}
Цитирование по этой ссылке на выпуск github :
Последний _score - это число с плавающей точкой, которое может представлять только целые числа.
точно до 2 ^ 25. Временные метки имеют порядок 2 ^ 40, поэтому
не могут быть представлены точно, следовательно, округление, которое вы
видя.