Bird
0
0

You want to search for the term "coffee" giving higher importance to the "title" field than "description" and "tags" fields. Which multi-match query correctly applies this weighting?

hard🚀 Application Q15 of 15
Elasticsearch - Basic Search Queries
You want to search for the term "coffee" giving higher importance to the "title" field than "description" and "tags" fields. Which multi-match query correctly applies this weighting?
A{ "multi_match": { "query": "coffee", "fields": ["title", "description", "tags"], "boost": 3 } }
B{ "multi_match": { "query": "coffee", "fields": ["title", "description^3", "tags"] } }
C{ "multi_match": { "query": "coffee", "fields": ["title", "description", "tags"], "type": "boost" } }
D{ "multi_match": { "query": "coffee", "fields": ["title^3", "description", "tags"] } }
Step-by-Step Solution
Solution:
  1. Step 1: Understand field boosting syntax

    To give more importance to a field, add a caret (^) and a boost number after the field name, e.g., "title^3".
  2. Step 2: Check each option for correct boosting

    { "multi_match": { "query": "coffee", "fields": ["title^3", "description", "tags"] } } boosts "title" by 3, others default. { "multi_match": { "query": "coffee", "fields": ["title", "description^3", "tags"] } } boosts "description" incorrectly. { "multi_match": { "query": "coffee", "fields": ["title", "description", "tags"], "boost": 3 } } tries to boost all fields equally with "boost" key, which is invalid here. { "multi_match": { "query": "coffee", "fields": ["title", "description", "tags"], "type": "boost" } } uses an invalid "type" value.
  3. Final Answer:

    { "multi_match": { "query": "coffee", "fields": ["title^3", "description", "tags"] } } -> Option D
  4. Quick Check:

    Use ^number to boost fields [OK]
Quick Trick: Boost fields with ^number after field name [OK]
Common Mistakes:
MISTAKES
  • Boosting wrong field
  • Using 'boost' key incorrectly
  • Setting invalid 'type' value

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes