Elasticsearch medium
A custom Analyzer consists of three modular stages. What is the execution order when a string enters the pipeline?
- A Tokenizer -> Token Filter -> Character Filter
- B Character Filter (Cleaning) -> Tokenizer (Splitting) -> Token Filter (Normalization)
- C Token Filter -> Character Filter -> Tokenizer
- D It is non-deterministic; the stages run in parallel to maximize CPU usage.
Answer: B. Character Filter (Cleaning) -> Tokenizer (Splitting) -> Token Filter (Normalization)
Order matters. You must strip HTML (Char Filter) *before* you split into words (Tokenizer). If you split first, the HTML tags might break the tokenizer's logic. Finally, once you have individual words, you can lowercase or remove small words like 'the' (Token Filter).
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- What are the two primary reasons for configuring one or more 'Replica Shards' for an index?
- When a String field is mapped as `text`, what process is performed to enable full-text search capability?
- What is the primary benefit of splitting an Elasticsearch index into multiple 'Primary Shards'?
- Every document stored in an Elasticsearch index is uniquely tracked by which mandatory metadata field?
- Elasticsearch search results include a metadata field called `_score`. What does this value primarily indicate?
- What is the primary architectural purpose of Elasticsearch in a modern software stack?