Faceted Search APIs: Dynamic, Category-Aware, and Scalable (on Elasticsearch)

This is Part 5 of the "Building a Scalable, Faceted Online Marketplace" series. Read the Introduction here.


Why Faceted Search APIs?

Faceted search is the backbone of modern e-commerce discovery. Users expect to filter by brand, price, color, rating, and more—dynamically, and with blazing speed. To deliver this at scale, we need robust, category-aware APIs powered by Elasticsearch.

What You'll Learn

Key Features

Example API Endpoints

Sample Elasticsearch Query

{
  "query": { ... },
  "aggs": {
    "brand": { "terms": { "field": "brand.keyword" } },
    "color": { "terms": { "field": "attributes.color.keyword" } },
    "price": { "range": { "field": "price", "ranges": [ ... ] } }
  }
}

Real-World Tips


Next up: Zero Downtime Reindexing & Unblocking in Elasticsearch


In the next article, we'll cover how to safely reindex and unblock Elasticsearch indices in production, with zero downtime!