Elastic Search
Elasticsearch (ES) is a fast, distributed search and analytics engine. It stores data in indexes (optimized for search) and returns results in near real time using features such as tokenization, analyzers (for language-aware search), and aggregations. In SellStack, ES powers high-performance product lookup and rich storefront filtering so customers and admins can find the right items quickly, even in large catalogs. SellStack indexes product data with selected attributes needed for search and filtering. We also index Lot information so customers can filter by Lot-level properties without slow database scans. Indexing runs automatically when relevant product/lot data changes.
Elasticsearch is used in SellStack in three places:
Storefront search (Shop → Search)
The search box in the shop uses ES to find products primarily by name (and other configured searchable fields). ES analyzers allow flexible matching (e.g., partial terms), making it more tolerant of user input while keeping results fast and relevant. A search input returns product matches immediately after submission. Results are ordered by relevance.
Admin → Products (name search)
In the Admin Products screen, administrators can search products by name using the standard database query or switch to the Elasticsearch-backed search. ES is recommended for very large catalogs or when you need consistent, relevance-based results.
Storefront filters (Shop → Filter menu)
Customers can filter results using the left-hand filter menu (see the screenshot you provided). ES powers two categories of filters:
A) Product attribute filtering (Brand)
Brand: Filter products by their brand. This is a standard product attribute indexed in ES. Selecting a brand narrows results to products tagged with that brand. B) Lot-aware filtering (custom ES implementation) SellStack supports products having multiple Lot numbers. Each Lot number may carry its own attributes, for example:
Expiration Date
THC
CBD
Strain Description
We implemented customized ES mappings/queries so customers can filter products by Lot attributes using:
Date filters (e.g., expiration date values),
Range filters for percentages (sliders for CBD and THC, 0–100%),
Text filters (e.g., Strain Description).
Matching logic - a product is included in the results if at least one of its lots satisfies the selected lot-attribute filters. In other words, when a customer sets lot filters, the product matches if there exists any single lot on that product that meets the active criteria (date/range/text). This enables realistic inventory discovery when different lots of the same product vary in composition or expiry.
Lot attribute appearance in the storefront filter panel is controlled in the Admin by toggling the “Show in shop filters” flag on each lot attribute. Disable this flag to hide a given lot attribute from customer filters without changing data.
Last updated