Facet filters and numeric filters solve different discovery problems in WooCommerce search. Facets let shoppers select from discrete values such as brand, color, size, or stock status. Numeric filters compare measurable values such as price, weight, rating, or dimensions. Choosing the correct filter type affects index configuration, frontend widgets, query performance, and the quality of the shopping experience.
What is a facet filter?
A facet represents a set of named values associated with a record. For a WooCommerce product, common facet attributes include brand, categories, pa_color, pa_size, and stock_status.
For example, a product record might contain:
{
"objectID": "8421",
"name": "Trail Running Shoe",
"brand": "Northstar",
"categories": ["Shoes", "Running"],
"pa_color": ["Black", "Red"],
"pa_size": ["42", "43"],
"price": 129.99,
"stock_status": "instock"
}
The values in brand, categories, and stock_status are suitable for facet filtering because a shopper selects one or more known labels. Configure these attributes in the Algolia index settings under attributesForFaceting:
[
"brand",
"categories",
"pa_color",
"pa_size",
"stock_status"
]
Use searchable(attribute) when shoppers need to search within a long facet value list, such as a large brand catalog:
[
"searchable(brand)",
"categories",
"pa_color",
"pa_size",
"stock_status"
]
Facet filter syntax
When using Algolia search parameters directly, facet selections are sent through facetFilters. Each nested array expresses an OR group, while separate entries are combined with AND:
{
"facetFilters": [
["brand:Northstar", "brand:SummitWorks"],
["pa_color:Black"],
["stock_status:instock"]
]
}
This query means the product must be from Northstar or SummitWorks, must be black, and must be in stock. In InstantSearch, the equivalent UI commonly uses RefinementList, Menu, or a custom checkbox component.
What is a numeric filter?
A numeric filter compares a numeric field against a value or range. Typical WooCommerce examples include sale price, regular price, average rating, review count, shipping weight, and product dimensions.
Numeric fields must be indexed as numbers, not formatted strings. A value such as 129.99 is usable for comparison; a value such as $129.99 is not. This distinction is especially important when transforming WooCommerce data, because currency symbols, thousands separators, and localized decimal formats should not be stored in the field used for filtering.
Declare the relevant attributes in numericAttributesForFiltering:
[
"price",
"regular_price",
"average_rating",
"review_count",
"weight"
]
A price range can then be expressed with numericFilters:
{
"numericFilters": [
["price >= 50", "price <= 150"]
]
}
The two comparisons in the same nested group form a range. If your integration uses the string-based filters parameter instead, the equivalent expression is:
price >= 50 AND price <= 150
Use an InstantSearch RangeInput or RangeSlider for an arbitrary price interval. Use NumericMenu when the store has fixed bands such as “Under $50”, “$50–$100”, and “Over $100”.
Facet filters versus numeric filters
- Facet filter: matches a discrete indexed value, such as
brand:Northstar. - Numeric filter: evaluates a comparison, such as
price <= 100. - Facet configuration: uses
attributesForFaceting. - Numeric configuration: uses
numericAttributesForFiltering. - Typical UI: checkboxes, lists, menus, and refinements for facets; sliders, range inputs, and numeric menus for numeric values.
- Data requirement: facet values are labels or identifiers; numeric values must be stored consistently as numbers.
Do not use a facet for every numeric-looking field
Product sizes illustrate an important edge case. Shoe sizes such as 38, 39, and 40 are often merchandising choices, not values that shoppers want to compare mathematically. They should usually be indexed as a facet, such as pa_size. By contrast, a capacity field such as storage_gb may be more useful as a numeric attribute if the store supports queries like “at least 512 GB”.
Price is also usually numeric. Creating a facet for every distinct price produces a long, low-value refinement list and does not support arbitrary ranges. If the business needs curated price bands, calculate a separate field such as price_band for facet navigation while retaining price as the numeric field:
{
"price": 129.99,
"price_band": "$100–$150"
}
The shopper can use price_band as a simple merchandising refinement or use price for a precise range.
Combining both filter types in a WooCommerce search
A typical category search may combine brand and color facets with a price range:
{
"facets": ["brand", "pa_color", "stock_status"],
"facetFilters": [
["brand:Northstar", "brand:SummitWorks"],
["pa_color:Black"],
["stock_status:instock"]
],
"numericFilters": [
["price >= 75", "price <= 175"]
]
}
This pattern is appropriate for a storefront where customers want products from selected brands, in a selected color, currently in stock, and within a particular budget. The filters are independent: changing the price range should not require generating price facet values, and changing the brand selection should not alter the numeric comparison.
Agency implementation checklist
- Define the shopper action. If the shopper selects a named option, use a facet. If the shopper needs greater than, less than, or between behavior, use a numeric attribute.
- Normalize WooCommerce data before indexing. Store prices and measurements as numbers, preserve taxonomy and attribute values as consistent strings, and avoid mixing units.
- Configure the index explicitly. Add discrete attributes to
attributesForFacetingand measurable attributes tonumericAttributesForFiltering. - Keep display data separate from filter data. Use a numeric
pricefield for filtering and a formatted currency value for rendering. - Test missing and malformed values. Products without a price or with inconsistent attribute types should not silently corrupt a range experience.
- Validate filter counts. Check that facet counts reflect the current query context and that the selected refinements remain visible when other filters are applied.
- Test index updates and reindexing. Confirm that price changes, stock changes, taxonomy edits, and attribute changes update the corresponding filter fields.
Common mistakes
- Indexing
priceas"129.99 USD"instead of a numeric value. - Using a facet for every unique price, creating an unusable refinement list.
- Sending a numeric comparison for a text field such as
pa_sizewhen the values are intended as selectable variants. - Failing to add a new facet attribute to
attributesForFaceting, causing the refinement to be unavailable. - Mixing pounds and kilograms in one numeric field without a normalization strategy.
- Assuming that a formatted WooCommerce display value can also serve as the Algolia filter value.
For WooCommerce agencies, the cleanest architecture usually keeps taxonomies and variation attributes as facets, stores prices and measurable specifications as numeric fields, and exposes both through a single combined search request. This gives merchandisers clear control over discrete product discovery while giving shoppers precise range-based filtering.