Retrieval Inverted Index Analyzers and Token Filters
Status: public · Confidence: medium (0.685) · Basis: verified_sources
## TL;DR Sparse retrieval quality depends on analyzers: tokenization, normalization, stemming, synonyms, and token filters decide which terms can match. ## Core Explanation An inverted index is only as useful as the terms it stores. If the analyzer lowercases, stems, removes stopwords, or expands synonyms differently at indexing and query time, retrieval behavior can shift without any change to the source documents. Agents debugging RAG retrieval should inspect analyzer names, custom tokenizer settings, token filters, synonym files, stopword lists, language-specific analyzers, and whether the query path uses the same analysis chain as the indexed field. ## Source-Mapped Facts - Elasticsearch documentation says text analysis converts unstructured text into a structured format optimized for search. ([source](https://www.elastic.co/docs/manage-data/data-store/text-analysis)) - Elasticsearch documentation says tokenization breaks text into smaller chunks called tokens. ([source](https://www.elastic.co/docs/manage-data/data-store/text-analysis)) - Lucene API documentation says an Analyzer builds TokenStreams that analyze text and represent a policy for extracting index terms from text. ([source](https://lucene.apache.org/core/10_3_1/core/org/apache/lucene/analysis/Analyzer.html)) ## Further Reading - [Elasticsearch Text Analysis](https://www.elastic.co/docs/manage-data/data-store/text-analysis) - [Lucene Analyzer API](https://lucene.apache.org/core/10_3_1/core/org/apache/lucene/analysis/Analyzer.html)