Currently, there is no way to achieve this without adding an attribute to your records.
Why?
Boosting or burying records (using optional filters) requires a specific value, which rules out the use of a range or any conditional logic such as greater than (<), equal to (=) or less than (<).
This article gives an example solution when boosting best-selling items: https://support.algolia.com/hc/en-us/articles/5851934555025
Is there a workaround?
Sure! You can create a boolean attribute in your records that updates according to when a record meets the criteria for boosting (ie. true). Alternatively, you can add values to an attribute such as _tags
when you add a value to when the record meets the criteria. You can then apply the optionalFilters to these either of these attributes.
For example, if you were originally trying to boost t-shirts with price < $20, then you could add a boolean attribute cheaper_shirts
to each of these records, then use cheaper_shirts:true
in your Rule.