Hi all!
I'm following the Elasticsearch documentation practicing the examples.
I trying to do this: https://www.elastic.co/guide/en/elasticsearch/guide/current/_tuning_best_fields_queries.html
I created two docs in my_index/my_type:
{
"_id": 1
"title": "Quick brown rabbits",
"body": "Brown rabbits are commonly seen."
}
and
{
"_id": 2
"title": "Keeping pets healthy",
"body": "My quick brown fox eats rabbits on a regular basis."
}
So, I performed the query:
{
"query": {
"dis_max": {
"queries": [
{ "match": { "title": "Quick pets" }},
{ "match": { "body": "Quick pets" }}
]
}
}
}
What is expected according with above link: obtain the same score in two results.
{
"hits": [
{
"_id": "1",
"_score": 0.12713557,
"_source": {
"title": "Quick brown rabbits",
"body": "Brown rabbits are commonly seen."
}
},
{
"_id": "2",
"_score": 0.12713557,
"_source": {
"title": "Keeping pets healthy",
"body": "My quick brown fox eats rabbits on a regular basis."
}
}
]
}
What I got: Different scores.
"hits": {
"total": 2,
"max_score": 0.02250402,
"hits": [
{
"_index": "my_index",
"_type": "my_type",
"_id": "2",
"_score": 0.02250402,
"_source": {
"title": "Keeping pets healthy",
"body": "My quick brown fox eats rabbits on a regular basis."
}
},
{
"_index": "my_index",
"_type": "my_type",
"_id": "1",
"_score": 0.016645055,
"_source": {
"title": "Quick brown rabbits",
"body": "Brown rabbits are commonly seen."
}
}
]
}
Why this occurs? Did I anything wrong? Is it dis_max relevance score broken?
Thank you!