A set describes one catalog filter: which products it includes, which filters, ranges and sorting to show, whether search is needed. You can have as many sets as you like — for example, one per shop or section. Each set is a file <name>.json in the sets folder (core/components/bitfacet/data/sets/) with its own index.
Edit sets on the Filter sets tab: "Create set" or the pencil next to a set. The window has the tabs Products, Filters, Ranges, Sorting, Search and JSON (the whole set as text, including rare settings). After saving, the index is rebuilt automatically.
Set name — lowercase Latin letters, digits, "-" and "_", up to 64 characters: catalog, shop-2.
Every filter takes its values from a field written as prefix:field. All available fields with captions are on the Sources tab.
| Prefix | Source | Examples |
|---|---|---|
res: | resource fields | res:parent (section and all its ancestors), res:template, res:pagetitle, res:publishedon, res:menuindex |
tv: | TV by name | tv:color. Multiple values (checkbox, listbox-multiple, tag) are split by "||", captions come from the input option values like Red==red |
ms: | MiniShop3 product | ms:price, ms:old_price, ms:article, ms:stock, ms:vendor, ms:color, ms:size, ms:tags, ms:new, ms:popular, ms:categories (extra categories) |
opt: | MiniShop3 options | opt:material — option key |
var: | variants (ms3Variants) | var:price, var:count, var:sku, variant options |
sql: | your tables | the sql block of the set — see "For developers" |
| Block | What it defines |
|---|---|
resources | Which resources are products: class_keys (e.g. MiniShop3\Model\msProduct), templates (template ids), parents (section ids — all descendants are taken), contexts, unpublished (include unpublished ones; they are still hidden on the site). Empty — no restriction. |
facets | List filters: key — source field, value — settings (may be []). |
numbers | From/to ranges: numbers and dates. |
sorts | Sorting: name → {"field": "ms:price", "label": "Price"}. Whether values compare as numbers or strings depends on the field; to force it — "kind": "number" or "string". |
search | Text search: fields with weights and synonyms. |
variants | Product variants (ms3Variants). |
sql, providers | Your tables and your PHP sources — "For developers". |
batch | Products read from the database per query while building (default 1000; less — less memory). |
{
"resources": {
"class_keys": ["MiniShop3\\Model\\msProduct"],
"parents": [5]
},
"facets": {
"section": {"type": "tree", "from": ["res:parent", "ms:categories"], "label": "Section"},
"ms:vendor": {"label": "Brand", "alias": "brand", "order": "count", "show": 10},
"ms:color": {"label": "Color"},
"ms:size": {"label": "Size", "order": "manual", "values_order": ["xs", "s", "m", "l", "xl"]},
"ms:instock": {"type": "bool", "from": ["ms:stock"], "label": "In stock"},
"opt:material": {"label": "Material", "collapsed": true}
},
"numbers": {
"ms:price": {"label": "Price", "step": 100}
},
"sorts": {
"price": {"field": "ms:price", "label": "Price"},
"title": {"field": "res:pagetitle", "label": "Name"},
"new": {"field": "res:publishedon", "label": "Newest"}
},
"search": {
"fields": {"ms:article": 5, "res:pagetitle": 3, "ms:vendor": 2, "res:introtext": 1},
"synonyms": {"sneakers": ["trainers", "kicks"]}
}
}
section is the service facet "section tree": it tells the filter which products are in which section and builds the Categories group. A product belongs to its section, the section's ancestors and MiniShop3 extra categories.ms:instock — a custom filter name with from: yes/no from the numeric stock (non-zero — "yes")."parents": [5] — only products of section 5 and its subsections.{
"resources": {"templates": [4], "contexts": ["web"]},
"facets": {
"section": {"type": "tree", "from": ["res:parent"]},
"tv:brand": {"label": "Manufacturer"},
"tv:fuel": {"label": "Fuel"},
"tv:options": {"label": "Equipment", "type": "multi", "mode": "and"}
},
"numbers": {
"tv:power": {"label": "Power, kW", "step": 1},
"res:publishedon": {"label": "Date", "type": "date"}
},
"sorts": {"title": {"field": "res:pagetitle", "label": "Name"}}
}
Products are resources with template 4. "mode": "and" on Equipment: products that have all checked items are shown.
The set editor writes them itself; the JSON tab shows the same.
| Key | Value |
|---|---|
label | Filter title on the site. |
alias | Name in the URL: "alias": "brand" → /catalog/brand-nike/. Default — the part of the key after ":" (ms:color → color). |
type | facet — one value per product, multi — several, bool — yes/no, tree — section tree; ranges: number or date. Default — from the source. |
from | Source fields when the filter key is a custom name: "from": ["res:parent", "ms:categories"]. |
mode | or (default) — a product matches if it has any of the checked values; and — all of them. "and" makes sense for multi-value fields (tags, features). |
order | Value order: empty — as in the source, alpha — alphabetical, count — by products in the whole catalog, manual — custom (values_order). |
values_order | Custom order — value keys. Easier to set on the Values tab by dragging rows. |
show | Show N values first, the rest under "Show all (M)". 0 — all. |
collapsed | true — the group is collapsed until something is checked in it. |
step | Ranges: step of the from/to fields; the boundary hints are rounded to it. |
labels, merge, hide | Custom captions, merging and hiding of values — written by the Values tab. |
php core/components/bitfacet/cli/rebuild.php <set>.Shop data is rarely clean: "Nike", "NIKE", "Nike Inc". The Values tab shows every filter value with its product count:
Product data is not changed — the rules are stored in the set:
"ms:vendor": {
"merge": {"nike inc": "nike"},
"hide": ["no brand"],
"labels": {"nike": "Nike"}
}
Value keys are as in the index: trimmed and lowercase.
The search block adds a search box to the filter. fields — where to search and the field weight (higher — ranked higher), synonyms — work both ways.
All query words must match; word endings (Russian stemmer), the start of the last word, transliteration, wrong keyboard layout, typos and synonyms are taken into account. Search results narrow the filter, counts are computed on them, the default sort is relevance.
The Search tab: check any query and see the visitors' query log; for a query with no results — add a synonym in one click.
If products have variants (size, color, own price), add the variants block and filters from var: fields:
"variants": {"pseudo": true},
"facets": {"var:size": {"label": "Size"}, "var:color": {"label": "Color"}},
"numbers": {"var:price": {"label": "Price"}}
All variant conditions must hold for one variant: "size M + red" finds a product only if it has a red variant of size M. Sorting by var:price uses the lowest variant price. pseudo — a product without variants counts as one variant built from its own fields (price, stock, article, options). Default ms3Variants tables are ms3_product_variants and ms3_variant_options; others go to variants.config (sudo only).
Index updates. ms3Variants fires no MODX events when variants are edited or their stock is deducted, so the update plugin does not learn about those changes: they reach the index on the next rebuild — manually on the "Index" tab or automatically on schedule (cron, at least every bitfacet.rebuild_max_age hours). If variants change often, lower rebuild_max_age. Compatibility verified with ms3Variants 1.0.2-beta.