Bird
0
0

How can you improve search relevance in Elasticsearch when searching a "description" field that contains synonyms like "car" and "automobile"?

hard🚀 Application Q9 of 15
Elasticsearch - Basics and Architecture
How can you improve search relevance in Elasticsearch when searching a "description" field that contains synonyms like "car" and "automobile"?
AUse a term query searching only for "car"
BUse a custom analyzer with a synonym filter during indexing
CDisable indexing on the "description" field
DUse a range query on the "description" field
Step-by-Step Solution
Solution:
  1. Step 1: Understand synonym handling

    To match synonyms, Elasticsearch needs to treat related words as equivalent during indexing or searching.
  2. Step 2: Choose method to handle synonyms

    Using a custom analyzer with a synonym filter allows Elasticsearch to index synonyms together, improving relevance.
  3. Final Answer:

    Use a custom analyzer with a synonym filter during indexing -> Option B
  4. Quick Check:

    Synonym handling = custom analyzer with synonym filter [OK]
Quick Trick: Synonyms require custom analyzers with synonym filters [OK]
Common Mistakes:
MISTAKES
  • Using term query which matches exact terms only
  • Disabling indexing removes search capability
  • Using range queries on text fields

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes