Wrong Scoring using match query on Sense


(rayman-2) #1

I am trying to exercise the following example using Sense
: http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/match-query.html.

However when I ran

GET /my_index/my_type/_search
{
"query": {
"match": {
"title": "QUICK!"
}
}
}

I got wrong scoring. I expect to see doc with is 3. But doc with id got
higher score. any idea?:

{
"took": 2,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"failed": 0
},
"hits": {
"total": 3,
"max_score": 0.5,
"hits": [
{
"_index": "my_index",
"_type": "my_type",
"_id": "1",
"_score": 0.5,
"_source": {
"title": "The quick brown fox"
}
},
{
"_index": "my_index",
"_type": "my_type",
"_id": "3",
"_score": 0.44194174,
"_source": {
"title": "The quick brown fox jumps over the quick dog"
}
},
{
"_index": "my_index",
"_type": "my_type",
"_id": "2",
"_score": 0.3125,
"_source": {
"title": "The quick brown fox jumps over the lazy dog"
}
}
]
}
}

Thanks.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/38002b2d-6d70-4a20-9820-7814c37e8aea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(Ivan Brusic) #2

If you enable explanations, you would see that length normalization is
scoring the document with the shorter field higher than the document with a
term frequency of 2.

The fieldNorm is incredibly lossy since it uses only 1 byte, so there must
be some inconsistencies between the example and your test case. The example
has a fieldNorm of 0.375, while it is 0.3125 in your case (and mine as
well). The example might not have deleted all the documents in the index
before the test.

Cheers,

Ivan

On Tue, Jul 1, 2014 at 1:43 AM, rayman idan.frid@gmail.com wrote:

I am trying to exercise the following example using Sense :
http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/match-query.html
.

However when I ran

GET /my_index/my_type/_search
{
"query": {
"match": {
"title": "QUICK!"
}
}
}

I got wrong scoring. I expect to see doc with is 3. But doc with id got
higher score. any idea?:

{
"took": 2,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"failed": 0
},
"hits": {
"total": 3,
"max_score": 0.5,
"hits": [
{
"_index": "my_index",
"_type": "my_type",
"_id": "1",
"_score": 0.5,
"_source": {
"title": "The quick brown fox"
}
},
{
"_index": "my_index",
"_type": "my_type",
"_id": "3",
"_score": 0.44194174,
"_source": {
"title": "The quick brown fox jumps over the quick dog"
}
},
{
"_index": "my_index",
"_type": "my_type",
"_id": "2",
"_score": 0.3125,
"_source": {
"title": "The quick brown fox jumps over the lazy dog"
}
}
]
}
}

Thanks.

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/38002b2d-6d70-4a20-9820-7814c37e8aea%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/38002b2d-6d70-4a20-9820-7814c37e8aea%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQAdM%3Dx6WfpbGVLRqiuVkF7QLXq0hZgCpqSSnc8A8nqHGQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


(system) #3