# How to increase score for documents matching multiple words in elasticsearch

**URL:** <https://discuss.elastic.co/t/how-to-increase-score-for-documents-matching-multiple-words-in-elasticsearch/299281>\
**Category:** Elasticsearch\
**Created:** [March 10, 2022, 3:16am UTC](https://discuss.elastic.co/t/how-to-increase-score-for-documents-matching-multiple-words-in-elasticsearch/299281 "2022-03-10T03:16:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ashu\_kumar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ashu_kumar/32/97855_2.png) [@Ashu\_kumar](https://discuss.elastic.co/u/Ashu_kumar)\
**Post date:** [March 10, 2022, 3:16am UTC](https://discuss.elastic.co/t/how-to-increase-score-for-documents-matching-multiple-words-in-elasticsearch/299281/1 "2022-03-10T03:16:24Z")

</div>

When I am searching for `dubai tour` , I am getting these results:

1. Dubai
2. iVenture Dubai Select Pass
3. Big Bus Dubai: Night Tour
4. Big Bus Dubai: Hop-On, Hop-Off Bus Tour
5. City Sightseeing Dubai: Hop-On, Hop-Off Bus Tour
6. At-The-Top Burj Khalifa: 124th & 125th Floor Ticket - Last Minute Availability & Instant Confirmation!

I am getting it because I am sorting the results on the basis of a field that is present in my document `totalScore` which may be more for `iVenture Dubai Select Pass` document. But in `iVenture Dubai Select Pass` only `dubai` is present but for other results like `Big Bus Dubai: Night Tour` both `dubai` and `tour` are present. So obviously document having both `dubai` and `tour` should be coming first, but It's not happening.

```auto
must: [
           {
          multi_match: {
            query: keyword,
            fields: ['servicename_regionname'],
              },
           },
         ],

```

How to fix this issue?

---

<div class="post-metadata">

**Author:** ![casterQ](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/casterq/32/93257_2.png) [@casterQ](https://discuss.elastic.co/u/casterQ)\
**Post date:** [March 10, 2022, 3:21am UTC](https://discuss.elastic.co/t/how-to-increase-score-for-documents-matching-multiple-words-in-elasticsearch/299281/2 "2022-03-10T03:21:07Z")

</div>

use function score

> **[Function score query | Elasticsearch Guide \[8.1\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/8.1/query-dsl-function-score-query.html)**

---

<div class="post-metadata">

**Author:** ![Ashu\_kumar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ashu_kumar/32/97855_2.png) [@Ashu\_kumar](https://discuss.elastic.co/u/Ashu_kumar)\
**Post date:** [March 10, 2022, 3:25am UTC](https://discuss.elastic.co/t/how-to-increase-score-for-documents-matching-multiple-words-in-elasticsearch/299281/3 "2022-03-10T03:25:17Z")

</div>

@casterQ how can i do that in this case ?

---

<div class="post-metadata">

**Author:** ![casterQ](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/casterq/32/93257_2.png) [@casterQ](https://discuss.elastic.co/u/casterQ)\
**Post date:** [March 10, 2022, 3:33am UTC](https://discuss.elastic.co/t/how-to-increase-score-for-documents-matching-multiple-words-in-elasticsearch/299281/4 "2022-03-10T03:33:20Z")

</div>

Can you provide index mappings and some data and you dsl for testing?

---

<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:** [April 7, 2022, 3:33am UTC](https://discuss.elastic.co/t/how-to-increase-score-for-documents-matching-multiple-words-in-elasticsearch/299281/5 "2022-04-07T03:33:34Z")

</div>

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