Bird
0
0

Which clause in an Elasticsearch bool query is used to exclude documents that match a condition?

easy🧠 Conceptual Q11 of 15
Elasticsearch - Basic Search Queries
Which clause in an Elasticsearch bool query is used to exclude documents that match a condition?
A<code>must</code>
B<code>must_not</code>
C<code>should</code>
D<code>filter</code>
Step-by-Step Solution
Solution:
  1. Step 1: Understand bool query clauses

    The bool query has four main clauses: must (required), should (optional), must_not (exclude), and filter (limit without scoring).
  2. Step 2: Identify exclusion clause

    The must_not clause excludes documents that match its conditions from the results.
  3. Final Answer:

    must_not -> Option B
  4. Quick Check:

    Exclude = must_not [OK]
Quick Trick: Exclude with must_not clause in bool query [OK]
Common Mistakes:
MISTAKES
  • Confusing must_not with must
  • Using should to exclude documents
  • Thinking filter excludes documents

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes