Bird
0
0

You need to retrieve documents where the field account.status exists and is not null. Which Elasticsearch query correctly accomplishes this?

hard🚀 Application Q8 of 15
Elasticsearch - Basic Search Queries
You need to retrieve documents where the field account.status exists and is not null. Which Elasticsearch query correctly accomplishes this?
A{"query": {"match": {"account.status": "not null"}}}
B{"query": {"term": {"account.status": "exists"}}}
C{"query": {"exists": {"field": "account.status"}}}
D{"query": {"exists": {"field_name": "account.status"}}}
Step-by-Step Solution
Solution:
  1. Step 1: Use the exists query

    The exists query checks for the presence of a field and ensures it is not null.
  2. Step 2: Verify syntax

    The correct key is field with the full field path account.status.
  3. Final Answer:

    {"query": {"exists": {"field": "account.status"}}} -> Option C
  4. Quick Check:

    Exists query matches non-null fields [OK]
Quick Trick: Exists query with 'field' key checks non-null fields [OK]
Common Mistakes:
MISTAKES
  • Using 'field_name' instead of 'field'
  • Using term or match queries incorrectly
  • Assuming exists matches null values

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes