Why this matters
- VaultCommerce autocomplete needs edge n-grams at index time; applying n-grams to the main
titlefield bloats index size — use a sub-field or dedicated suggest index. - Search analytics indices grow daily — ILM rolls
vaultcommerce-search-logs-*to warm nodes, then deletes after 90 days. - Elasticsearch 8.x licensing shifted; AWS OpenSearch is a fork — know which engine your org runs and test client compatibility.
Cluster
Node 1Shard 0 primary
Node 2Shard 1 primary
Node 3Shard 0 replica
Custom analyzers
PUT /vaultcommerce-products
{
"settings": {
"analysis": {
"analyzer": {
"title_search": {
"type": "custom",
"tokenizer": "standard",
"filter": ["lowercase", "asciifolding", "english_stemmer"]
},
"title_suggest": {
"type": "custom",
"tokenizer": "standard",
"filter": ["lowercase", "edge_ngram_filter"]
}
},
"filter": {
"english_stemmer": { "type": "stemmer", "language": "english" },
"edge_ngram_filter": { "type": "edge_ngram", "min_gram": 2, "max_gram": 15 }
}
}
},
"mappings": {
"properties": {
"title": {
"type": "text",
"analyzer": "title_search",
"fields": {
"suggest": { "type": "text", "analyzer": "title_suggest" }
}
}
}
}
}
Search queries target title; typeahead targets title.suggest — different analyzers, different purposes.
Analyzer components
- Character filters — strip HTML, map chars (
&→and). - Tokenizer — split stream into tokens (standard, whitespace, keyword).
- Token filters — lowercase, stem, n-gram, synonym expansion.
The rest of this guide is part of Pro
Free covers every fresher guide in full. Pro unlocks Senior, Staff and Architect guides across every track.
Still to come · 2 sections
- Index Lifecycle Management
- Reindex without downtime
Test yourself
Answer these before moving on — recall is what makes it stick.