Skip to main content
The attributeCriteriaComputedBy parameter controls how Algolia calculates the Attribute ranking criterion, mainly for multi-word queries with matches in more than one attribute. It supports three strategies: best (default), minProximity, and sum.

Options

Picks the best matching attribute from the attributes that form the best proximity score. On an ordered attribute, the match position breaks ties.The order of the Attribute and Proximity ranking criteria affects the best strategy. By default, Proximity comes before Attribute, so Algolia uses minProximity instead of best. To use best, move Attribute before Proximity in ranking.Both minProximity and sum work with either order.
Picks the best matching attribute from all attributes that match any query word. On an ordered attribute, the match position breaks ties.
Adds a score for every query word instead of picking one attribute. The score depends on the matching attribute and, for ordered attributes, the position of the match. Words that don’t match add a large penalty. Records with lower total scores rank higher.With sum, a record can’t rank highly based only on one query word matching an attribute with higher priority in the searchableAttributes list.

Usage

Use sum with short, relevant attributes, and set long-text attributes to unordered in searchableAttributes. sum combines attribute rank and word position into one score. When an ordered attribute is long, a match deep inside it can outrank a better match spread across two attributes. Suppose a store has the following searchableAttributes and users search for black jeans:
JSON
  • Record A matches black in color and jeans in category.
  • Record B matches black in color and jeans in name.
With sum, record A ranks higher, because both words matched in the top attribute group.

Example

See also

Last modified on October 22, 2026