Bird
0
0

Consider the following Elasticsearch query:

medium📝 Predict Output Q4 of 15
Elasticsearch - Basic Search Queries
Consider the following Elasticsearch query:
{"query": {"exists": {"field": "user.email"}}}
Which documents will this query return?
ADocuments where the field <code>user</code> exists regardless of <code>email</code>.
BDocuments where the field <code>user.email</code> exists and is not null.
CDocuments where the field <code>email</code> exists anywhere in the document.
DDocuments where the field <code>user.email</code> is null.
Step-by-Step Solution
Solution:
  1. Step 1: Understand the field path

    The query checks for the existence of the nested field user.email.
  2. Step 2: Determine matching documents

    Only documents where user.email exists and is not null will be returned.
  3. Final Answer:

    Documents where the field user.email exists and is not null. -> Option B
  4. Quick Check:

    Exists query matches non-null fields only [OK]
Quick Trick: Exists query matches documents with non-null specified field [OK]
Common Mistakes:
MISTAKES
  • Assuming parent field existence is enough
  • Thinking null fields are matched
  • Confusing nested field with top-level field

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes