Bird
0
0

Find the mistake in this query:

medium📝 Debug Q7 of 15
Elasticsearch - Basic Search Queries
Find the mistake in this query:
{ "query": { "match": { "body": { "query": "search text", "minimum_should_match": 3 } } } }

Assuming the search text has only two words.
A"query" field is missing
B"minimum_should_match" cannot be greater than the number of words in query
C"body" should be outside match
D"minimum_should_match" must be a boolean
Step-by-Step Solution
Solution:
  1. Step 1: Understand minimum_should_match usage

    This parameter sets how many words must match. It cannot require more matches than words present.
  2. Step 2: Apply to given query

    With only two words, setting minimum_should_match to 3 requires more matches than words present, which is invalid.
  3. Final Answer:

    "minimum_should_match" cannot be greater than the number of words in query -> Option B
  4. Quick Check:

    minimum_should_match ≤ number of query words [OK]
Quick Trick: minimum_should_match must not exceed query word count [OK]
Common Mistakes:
MISTAKES
  • Setting minimum_should_match higher than word count
  • Confusing minimum_should_match with boolean
  • Misplacing the body field

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes