Bird
0
0

Which field type is best suited for a term query in Elasticsearch?

easy🧠 Conceptual Q2 of 15
Elasticsearch - Basic Search Queries
Which field type is best suited for a term query in Elasticsearch?
AKeyword field
BGeo-point field
CDate field
DText field with analyzer
Step-by-Step Solution
Solution:
  1. Step 1: Identify field types for exact matching

    Keyword fields store exact values without analysis, ideal for term queries.
  2. Step 2: Exclude other field types

    Text fields are analyzed, dates and geo-points require different queries.
  3. Final Answer:

    Keyword field -> Option A
  4. Quick Check:

    Term query = Keyword field [OK]
Quick Trick: Use keyword fields for exact term queries [OK]
Common Mistakes:
MISTAKES
  • Using text fields with term query expecting exact match
  • Trying term query on date or geo fields
  • Ignoring field mapping types

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes