Why this matters
- VaultCommerce faceted browse ("outdoor, $50–$100, 4+ stars") needs category and price histograms without loading every product into the app server.
- Aggregations on analyzed
textfields fail — facet onkeywordfields only. - Heavy aggregations on high-cardinality fields (SKU) stress data nodes — design dashboards with rollups or separate indices.
Cluster
Node 1Shard 0 primary
Node 2Shard 1 primary
Node 3Shard 0 replica
Metric aggregations
GET /vaultcommerce-products/_search
{
"size": 0,
"aggs": {
"avg_price": { "avg": { "field": "price" } },
"price_stats": { "stats": { "field": "price" } },
"categories": { "cardinality": { "field": "category" } }
}
}
size: 0 returns only aggregation results — standard for dashboard APIs that do not need individual hits.
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 · 3 sections
- Bucket aggregations for facets
- Sub-aggregations
- Composite pagination for high cardinality
Test yourself
Answer these before moving on — recall is what makes it stick.