Currently, there is a hard limit of 300 items that can be pinned using Rules. This limit ensures optimal performance levels for both your search results and the Visual Editor.
However, you may find on occasions that you want to promote more records than this. Although this isn’t recommended from a UX perspective, in such cases it’s often more efficient to use optionalFilters or ranking logic instead of using a rule to manually pin each product.
Option 1: Using optionalFilters
Instead of pinning each product individually, you can add a boolean attribute to your records and use optionalFilters to boost records that match a specific criteria. For example:
{
"optionalFilters":"in_stock:true"
}This approach works well when you want particular products to appear first but are not concerned with fixing their exact positions.
You can read more on promoting records with optionalFilters here.
Option 2: Use a “Pinned Position” attribute
There may be a more complex scenario where you want your products to appear in specific positions.
If you can determine these positions, you can add them to your records as an attribute, such as: "pinned_position":1. Products without a pinned position can be assigned a single default value.
Example
Note this example only works if the same pinning logic applies across all queries as it will be applied at an index level.
Imagine you have 2,000 records, and you want 500 of them to appear in fixed positions.
Add an attribute like
pinned_positionto your records.For items that must appear in a specific order, assign a unique numeric value (1, 2, 3, etc.).
For all other items, assign a single very high value (eg. 9999).
You can then:
Use a sort-by attribute for exhaustive sorting if the order must be exact.
Add
pinned_positionto your custom ranking if you still want Algolia’s relevance criteria to influence the order.
Please note this is an implementation example, and may be completely different for your use case. The Algolia Support team cannot give tailored implementation advice beyond the documented functionality of our products.