Elasticsearch & Lucene (50 Qs)•Part 2: Core Architecture & Implementation (Mid-Level)
How does Synonym filtering work in search?
senior LevelSystem Design
In Simple Words:
Synonym token filters map alternative words to the same concept (e.g. ["couch", "sofa"] or ["laptop", "notebook"]):
- Index-time Synonyms: Expands synonyms when writing to disk. Fast search, but changes require reindexing the entire index!
- Search-time Synonyms (Best Practice): Expands synonyms dynamically only when the query runs. Updating the synonym dictionary takes effect immediately without rebuilding indices.