# Scores are inconsistent with data and query

**URL:** <https://discuss.elastic.co/t/scores-are-inconsistent-with-data-and-query/343121>\
**Category:** Elasticsearch\
**Created:** [September 15, 2023, 9:03am UTC](https://discuss.elastic.co/t/scores-are-inconsistent-with-data-and-query/343121 "2023-09-15T09:03:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![appsol](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/appsol/32/116381_2.png) [@appsol](https://discuss.elastic.co/u/appsol)\
**Post date:** [September 15, 2023, 9:03am UTC](https://discuss.elastic.co/t/scores-are-inconsistent-with-data-and-query/343121/1 "2023-09-15T09:03:05Z")

</div>

Hello,  
My document has a title field and an intro field. I have given greater importance to the title field over the intro field in my query, yet all other fields being equal, the intro field is getting a higher score than the title field. Can anyone point out where I'm going wrong?  
Query:

```auto
"body" => array:4 [
    "query" => array:1 [
      "function_score" => array:2 [
        "query" => array:1 [
          "bool" => array:4 [
            "must" => []
            "should" => array:15 [
              0 => array:1 [
                "match" => array:1 [
                  "title" => array:4 [
                    "query" => "test"
                    "boost" => 1
                    "fuzziness" => "AUTO"
                    "operator" => "OR"
                  ]
                ]
              ]
              1 => array:1 [
                "match" => array:1 [
                  "title" => array:4 [
                    "query" => "test"
                    "boost" => 2
                    "fuzziness" => "AUTO"
                    "operator" => "and"
                  ]
                ]
              ]
              2 => array:1 [
                "match_phrase" => array:1 [
                  "title" => array:2 [
                    "query" => "test"
                    "boost" => 3
                  ]
                ]
              ]
              3 => array:1 [
                "match" => array:1 [
                  "organisation_name" => array:4 [
                    "query" => "test"
                    "boost" => 1
                    "fuzziness" => "AUTO"
                    "operator" => "OR"
                  ]
                ]
              ]
              4 => array:1 [
                "match" => array:1 [
                  "organisation_name" => array:4 [
                    "query" => "test"
                    "boost" => 2
                    "fuzziness" => "AUTO"
                    "operator" => "and"
                  ]
                ]
              ]
              5 => array:1 [
                "match_phrase" => array:1 [
                  "organisation_name" => array:2 [
                    "query" => "test"
                    "boost" => 3
                  ]
                ]
              ]
              6 => array:1 [
                "match" => array:1 [
                  "intro" => array:4 [
                    "query" => "test"
                    "boost" => 1
                    "fuzziness" => "AUTO"
                    "operator" => "OR"
                  ]
                ]
              ]
              7 => array:1 [
                "match" => array:1 [
                  "intro" => array:4 [
                    "query" => "test"
                    "boost" => 1.5
                    "fuzziness" => "AUTO"
                    "operator" => "and"
                  ]
                ]
              ]
              8 => array:1 [
                "match_phrase" => array:1 [
                  "intro" => array:2 [
                    "query" => "test"
                    "boost" => 2.5
                  ]
                ]
              ]
              9 => array:1 [
                "match" => array:1 [
                  "description" => array:4 [
                    "query" => "test"
                    "boost" => 0.5
                    "fuzziness" => "AUTO"
                    "operator" => "OR"
                  ]
                ]
              ]
              10 => array:1 [
                "match" => array:1 [
                  "description" => array:4 [
                    "query" => "test"
                    "boost" => 1.5
                    "fuzziness" => "AUTO"
                    "operator" => "and"
                  ]
                ]
              ]
              11 => array:1 [
                "match_phrase" => array:1 [
                  "description" => array:2 [
                    "query" => "test"
                    "boost" => 2
                  ]
                ]
              ]
              12 => array:1 [
                "match" => array:1 [
                  "taxonomy_categories" => array:4 [
                    "query" => "test"
                    "boost" => 0.5
                    "fuzziness" => "AUTO"
                    "operator" => "OR"
                  ]
                ]
              ]
              13 => array:1 [
                "match" => array:1 [
                  "taxonomy_categories" => array:4 [
                    "query" => "test"
                    "boost" => 1
                    "fuzziness" => "AUTO"
                    "operator" => "and"
                  ]
                ]
              ]
              14 => array:1 [
                "match_phrase" => array:1 [
                  "taxonomy_categories" => array:2 [
                    "query" => "test"
                    "boost" => 1.5
                  ]
                ]
              ]
            ]
            "filter" => array:1 [
              0 => array:1 [
                "range" => array:1 [
                  "end_date" => array:1 [
                    "gte" => "now/d"
                  ]
                ]
              ]
            ]
            "minimum_should_match" => 1
          ]
        ]
        "functions" => []
      ]
    ]
    "sort" => array:1 [
      0 => "_score"
    ]
    "from" => 0
    "size" => 20
  ]

```

Hits:

```auto
-hit: array:5 [
          "_index" => "testing_events"
          "_type" => "_doc"
          "_id" => "e7c8164a-7b77-498b-98ce-031d32ea7bcb"
          "_score" => 5.0830793
          "_source" => array:12 [
            "id" => "e7c8164a-7b77-498b-98ce-031d32ea7bcb"
            "title" => "Organisation Event Title"
            "intro" => "This is a test"
            "description" => "Nulla consequat massa quis enim Donec pede justo fringilla vel aliquet nec vulputate eget arcu In enim justo rhoncus ut imperdiet a venenatis vitae justo Nullam dictum felis eu pede mollis pretium "
            "start_date" => "2023-10-08T20:17:21"
            "end_date" => "2023-10-08T09:37:54"
            "is_free" => true
            "is_virtual" => true
            "organisation_name" => "Baker Ltd fuga 80510"
            "taxonomy_categories" => []
            "collection_categories" => []
            "event_location" => null
          ]
        ]

-hit: array:5 [
          "_index" => "testing_events"
          "_type" => "_doc"
          "_id" => "7e01f0a3-02c4-48cd-980b-23c15f2935f1"
          "_score" => 4.8155494
          "_source" => array:12 [
            "id" => "7e01f0a3-02c4-48cd-980b-23c15f2935f1"
            "title" => "This is a test"
            "intro" => "Lorem ipsum dolor sit amet consectetuer adipiscing elit"
            "description" => "Nulla consequat massa quis enim Donec pede justo fringilla vel aliquet nec vulputate eget arcu In enim justo rhoncus ut imperdiet a venenatis vitae justo Nullam dictum felis eu pede mollis pretium "
            "start_date" => "2023-10-15T10:35:40"
            "end_date" => "2023-10-15T20:08:36"
            "is_free" => true
            "is_virtual" => true
            "organisation_name" => "Fox Ltd amet 57268"
            "taxonomy_categories" => []
            "collection_categories" => []
            "event_location" => null
          ]
        ]

```

Thanks

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 13, 2023, 9:03am UTC](https://discuss.elastic.co/t/scores-are-inconsistent-with-data-and-query/343121/2 "2023-10-13T09:03:09Z")

</div>

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