Often times, you may realize that in order to do what you need to do, you will need to pin several items-- say, dozens or up to 300 (the default limit).
Sometimes, you may consider that the same effect can be accomplished by adding a boolean attribute to your record and boosting by it (i.e, in_stock = 1, optionalFilter on in_stock). Other times, you may have a large number of specific items to be pinned under specific conditions. Consider the following scenario:
You have N factors that you want to consider when deciding whether item X is pinned to position A.
Position A is ultimately an integer.
If you make the calculations of what constitutes position A outside of Algolia, ultimately what you need to represent in Algolia is a number in the record.
Here is an example. (Please note that this is an implementation example, and may be completely different for your use case. Please additionally note that the Algolia support team cannot give implementation advice.)
You can have, say 2000 records.
Say you want to have a fixed position for 1000 of those records. You can have attribute_x be the "pinned" position, and if those items don't have a pinned position, have that value be some arbitrarily large or small number. The other pinned positions are a static number. If it is critical that the items are in those exact positions, use exhaustive sorting . If it is not and you want the other 8 relevancy criteria to factor in as well, use relative sorting and add attribute_x to your custom ranking .