How to increase score for documents matching multiple words in elasticsearch

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.

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

How to fix this issue?

use function score

@casterQ how can i do that in this case ?

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

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