Analyzers
An analyzer turns raw text into a token stream. The analyzer is chosen at index-create time. Text fields use the index's analysis.analyzer.default when the index declares one, and standard otherwise. ([fts] default_analyzer in the node config is accepted but not wired in this build; setting it logs a warning at startup.)
standard
The default. Unicode-aware segmentation and lowercasing. No stop words and no stemming: "running", "runs" and "run" are three different terms, so a query for one does not find the others. Correct for logs, identifiers and code. Equivalent to ES's standard analyzer.
whitespace
Splits on whitespace only. No lowercasing, no stop words. Use when you want exact token matching on multi-word identifiers or code.
english
Standard + English stop words + English stemming (Snowball, Porter2). "running" and "runs" both index as "run", so a query for either finds both. Disable with [indexing] turbo_fast_analyzer = true to trade recall for ingest speed — the turbo path skips stemming for documents classified as log-shaped.
stemmer
Standard + English stemming, without the stop-word list. Use it when you want stemming but short words such as "not" or "it" still matter.
Turn on stemming for English prose
The default analyzer does not stem, and that costs BM25 relevance on English prose. On the BEIR NFCorpus test set, XERJ BM25 scores nDCG@10 0.3016 with the default analyzer and 0.3195 with the stemmer analyzer (Query-1 benchmark, 2026-11-06). For articles, docs, tickets or chat, set an English analyzer as the index default when you create the index:
$ curl -sX PUT http://localhost:9200/articles \
-H 'Content-Type: application/json' \
-d '{
"settings": { "analysis": { "analyzer": { "default": { "type": "english" } } } },
"mappings": { "properties": {
"title": { "type": "text" },
"body": { "type": "text" }
} }
}'
Use "type": "stemmer" instead of "english" to stem without dropping stop words. The analyzer is fixed when the index is created: to change it, create a new index with the setting and reindex into it.
Check the analyzer a field is indexed with:
$ curl -s http://localhost:9200/articles/_analyze \
-H 'Content-Type: application/json' \
-d '{ "field": "body", "text": "The running dogs" }'
# expected tokens with english: "run", "dog"
# with the default (standard): "the", "running", "dogs"
Per-field analyzers
An "analyzer" on one text field in the mapping is accepted and shown by GET /<index>/_mapping, but this build does not apply it: every text field is analyzed with the index default. To stem, set the index default as shown above, and use the _analyze check to see the analyzer actually in use.
Source · engine/crates/xerj-fts/src/analyzer.rs