A custom analyzer assembles user-selected character filters, one tokenizer, and zero or more token filters. Use it when a built-in analyzer cannot produce the tokens your search requirements need. Character filters clean or rewrite input first, the tokenizer splits it, and token filters transform the resulting tokens. section 7.4 section 7.9
Normalize HTML and uppercase words
Create the analyzer in index settings: PUT index_with_custom_analyzer { "settings": { "analysis": { "analyzer": { "custom_analyzer": { "type": "custom", "char_filter": ["html_strip"], "tokenizer": "standard", "filter": ["uppercase"] } } } } } Test it with `POST index_with_custom_analyzer/_analyze` and the text `<H1>HELLO, WoRLD</H1>`. HTML tags are removed, standard tokenization produces two words, and the uppercase filter returns `HELLO` and `WORLD`. section 7.4
Define named analysis components alongside the analyzer when defaults are insufficient. A mapping character filter can convert symbols such as α, β, and γ into words, while a keep filter can discard every token except `alpha`, `beta`, and `gamma`. Test the complete pipeline before relying on its indexed output. section 7.4.1
For quick experiments, the `_analyze` API can mix a tokenizer and filters without creating a named index analyzer. A path hierarchy tokenizer with an uppercase filter turns `/Volumes/FILES/Dev` into `/VOLUMES`, `/VOLUMES/FILES`, and `/VOLUMES/FILES/DEV`. section 7.2.4
