A bug for the score calculation in Elastic Search


(zhiguo) #1

Hi, Expert,

I just found one wired issue for the score of matching.

The message is like this:

GET /scenario/group_2/1
{
"message" : "test search 1, 0",
"score":8.201733
}

After matching by phrase, i got:

"hits": {
"total": 1,
"max_score": 3.9513056,
"hits": [
{
"_index": "scenario",
"_type": "group_2",
"_id": "1",
"_score": 3.9513056,
"_source": {
"message": "test search 1, 0",
"score": 8.201733
}

The score is 3.9513056.

But after i search with:

GET /scenario/_search
{
"query" : {
"match" : {
"message" : "test search 1, 1"
}
}
}

Please note the latest number is 1. And the result is:

hits": {
"total": 4,
"max_score": 4.5427876,
"hits": [
{
"_index": "scenario",
"_type": "group_2",
"_id": "1",
"_score": 4.5427876,
"_source": {
"message": "test search 1, 0",
"score": 8.201733
}
},

The score is 4.5427876 which is higher than the one when match by phrase.

This does not make sense.

Please let me know the reason and how to avoid this.


(Mark Harwood) #2

Can you provide the first query that produced the 3.9513056 score?


(system) #3

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.