Web / Apache Lucene Interview questions
When should you use StandardAnalyzer vs a custom Analyzer?
StandardAnalyzer is a solid default for general-purpose English (and reasonably good multilingual) text: Unicode-aware tokenization, lowercasing, and English stopword removal cover the majority of "search this article/product description" use cases out of the box.
A custom Analyzer earns its complexity when the domain has specific needs StandardAnalyzer doesn't address - code search where camelCase and punctuation carry meaning, part numbers with embedded hyphens that must stay intact, heavy synonym requirements, or non-English content needing language-specific stemming and stopwords.
A practical rule: start with StandardAnalyzer (or a language-specific built-in like EnglishAnalyzer), and only build a custom Tokenizer/TokenFilter chain once a concrete, observed search-quality gap justifies the added maintenance cost.
More Related questions...