Currently, there is no way to achieve this without adding an attribute to your records.
Why?
Boosting or burying records relies on optionalFilters which do not support numeric comparisons. This means you cannot use conditions such as greater than (<), equal to (=) or less than (<) with numeric values.
This also means, when using the Visual Editor, it is not possible to use numeric attributes (ie. attributes that hold numeric values) when choosing which category to boost.
Is there a workaround?
Sure! You can modify your data in either of the following ways:
- Create a boolean attribute in your records that updates to
truewhen a record meets the criteria for boosting. - Add values to an attribute such as
_tagswhen the record meets the criteria.
You can then apply optionalFilters to these either of these attributes or select them as the category for boosting.
Examples
If you were originally trying to boost t-shirts with price < $20 (price < 20), you could:
- add a boolean attribute
cheaper_shirtsto each of these records - use
cheaper_shirts:truein your Rule to boost them
This article gives an example solution for boosting best-selling items: https://support.algolia.com/hc/en-us/articles/5851934555025