Why this matters
- VaultCommerce product SKUs must be
keyword(exact match, aggregations); descriptions must betext(analyzed for search). Swapping them breaks faceted filters and full-text queries. - Bulk indexing during catalog sync needs the
_bulkAPI — single-document PUTs cannot keep up with nightly imports. - Mapping mistakes (e.g.,
pricemapped as text) require reindex — expensive at millions of documents.
Cluster
Node 1Shard 0 primary
Node 2Shard 1 primary
Node 3Shard 0 replica
Explicit mapping for products
curl -X PUT "localhost:9200/vaultcommerce-products" -H 'Content-Type: application/json' -d'
{
"mappings": {
"properties": {
"sku": { "type": "keyword" },
"title": { "type": "text", "fields": { "raw": { "type": "keyword" } } },
"description":{ "type": "text" },
"category": { "type": "keyword" },
"price": { "type": "float" },
"in_stock": { "type": "boolean" },
"tags": { "type": "keyword" }
}
}
}'
keyword vs text
keyword— stored as-is for filters, sorting, aggregations (SKU, category).text— analyzed (tokenized, lowercased) for full-text search (title, description).- Multi-fields —
title.rawkeyword sub-field for exact sort whiletitleremains searchable.
Dynamic mapping works for prototypes; VaultCommerce locks mapping before production indexing.
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
- CRUD operations
- Bulk import for catalog sync
Test yourself
Answer these before moving on — recall is what makes it stick.