If you're trying to hide specific products in your Algolia search results, and those products don’t share a common category, price, or other easily filterable attribute, a custom boolean field can be a flexible and scalable solution.
Recommended approach: Use a custom boolean attribute
To control product visibility at the individual record level, add a custom boolean attribute to each record, for example, "hidden", and assign a value of true or false.
Set
"hidden": truefor items you want to exclude from search results.Set
"hidden": false(or omit the attribute) for items you want to include.
You can then filter out hidden items either with a filtering expression or via Rules, depending on your use case.
Example record with a hidden attribute:
{
"objectID": "123",
"name": "Example Product",
"hidden": true
}Resources for implementation
This method gives you full control over visibility at the record level, even when the products aren't related by any shared attribute.