The site reports changes to BitFacet itself (the bitfacet.update plugin), and the filter sees them from the next request:
bitfacet.journal_max changes or the first one is older than bitfacet.rebuild_delay seconds, the index is rebuilt completely.bitfacet.rebuild_max_age) or the Rebuild button.Visitors never see a half-built index: a new build is written next to the old one and swapped by renaming one file.
php @@core_path@@components/bitfacet/cli/rebuild.php # all sets
php @@core_path@@components/bitfacet/cli/rebuild.php catalog # one set
php @@core_path@@components/bitfacet/cli/rebuild.php --if-due # only when due (for cron)--if-due: rebuilds only if the index is outdated, the journal is long, changes are older than the delay or the build is older than a day.
*/5 * * * * @@php@@ @@core_path@@components/bitfacet/cli/rebuild.php --if-due
The line with this site's paths, the fields for a hosting panel and the last run are on the Index tab. Cron can be switched off by a setting without touching crontab.Build history (who, when, why, products, time, memory, error) and the error log are on the Index tab.
In the bitfacet.index_path folder (default core/components/bitfacet/data/index/), one folder per set. The index can be deleted — it will be rebuilt. Read modes (bitfacet.storage):
opcache — the index is PHP files in opcache shared memory: opening it takes a fraction of a millisecond. The fastest.file — files are read on every request: works everywhere, several times slower.auto (default) — opcache if it is enabled and has room, otherwise file. Overview warns about the switch.Measured on 369k products (15 filters): rebuild 8–12 s and about 410 MB of memory, index 52 MB, filter query 2–11 ms, page 21–34 ms. Raise the limits for large catalogs:
| Products in the set | memory_limit | opcache.memory_consumption |
|---|---|---|
| up to 50,000 | 256M | 128M |
| up to 150,000 | 256M | 256M |
| up to 400,000 | 512M | 512M |
| Setting | Default | What it does |
|---|---|---|
bitfacet.storage | auto | Index read mode: auto, opcache, file. |
bitfacet.journal_max | 100 | Changes kept in the journal before a full rebuild. |
bitfacet.rebuild_delay | 300 | Seconds after the first change before the index is rebuilt. |
bitfacet.rebuild_max_age | 24 | Every this many hours cron rebuilds the index completely (0 — not by age). |
bitfacet.build_keep_days | 30 | Days to keep build history (0 — forever). |
bitfacet.cron_enabled, bitfacet.cron_interval | yes, 5 | Cron is on; interval in minutes for the crontab line and the "not run for long" check. |
bitfacet.index_path, bitfacet.sets_path | in core/components/bitfacet/data/ | Index and set folders. Changed on the Settings tab; site folders (root, core, assets) cannot be chosen. |