When pinning items using the Visual Editor, the option “Pinned items must match active filters to be displayed” ensures that only products matching the query filters are pinned.
If you wish for products to be automatically excluded from being pinned when they go out of stock, follow these steps (as outlined in this guide article):
- Have an attribute such as
in_stock:true | false
- Add a filter at the global level (either using a conditionless rule or by passing it for each query) to display only products with
in_stock:true
-
When pinning a product, you make sure to keep this checkbox ticked.
This way, if a pinned product goes out of stock, it will be filtered out automatically.
Please note that there is currently no option to keep out of stock products in your search results but have them automatically unpinned when they go out of stock. To bury (rather than hide) out-of-stock items, you would typically use Optional Filters, but these are overridden by pinning.
This is because the engine applies the relevance strategies in the following order
- Textual ranking criteria
- Business relevance (custom ranking)
- Personalisation (if you’ve enabled it and the engine has enough information to personalise results for a particular user)
- Boosting and burying categories with Rules (optional filters)
- Dynamic Re-Ranking
- Promoting and hiding specific items with Rules
Since pinning is applied last, it takes priority and will override any previous burying logic, including Optional Filters.