attributeCriteriaComputedByMinProximity
false
'attributeCriteriaComputedByMinProximity' => true|false
Can be used in these methods:
search,
setSettings,
browseObjects,
searchForFacetValues,
generateSecuredApiKey,
addApiKey,
updateApiKey
search,
set_settings,
browse_objects,
search_for_facet_values,
generate_secured_api_key,
add_api_key,
update_api_key
search,
setSettings,
browseObjects,
searchForFacetValues,
generateSecuredApiKey,
addApiKey,
updateApiKey
search,
set_settings,
browse_objects,
search_for_facet_values,
generate_secured_api_key,
add_api_key,
update_api_key
search,
setSettings,
browse,
searchForFacetValues,
generateSecuredApiKey,
addAPIKey,
updateAPIKey
search,
setSettings,
browseObjects,
searchForFacetValues,
generateSecuredApiKey,
addApiKey,
updateApiKey
Search,
SetSettings,
Browse,
SearchForFacetValues,
GenerateSecuredApiKey,
AddApiKey,
UpdateApiKey
Search,
setSettings,
browse,
searchForFacetValues,
generateSecuredApiKey,
addApiKey,
updateApiKey
Search,
SetSettings,
BrowseObjects,
SearchForFacetValues,
GenerateSecuredAPIKey,
AddAPIKey,
UpdateAPIKey
search,
setSettings,
browse index,
search into facet values,
generateSecuredApiKey,
add key,
update key
About this parameter
When the Attribute criterion is ranked higher than Proximity in your ranking formula, Proximity selects which searchable attribute is matched in the Attribute criterion.
Usage notes
This parameter only affects relevance when Attribute comes before Proximity in the ranking formula. By default, this isn’t the case: searches that match several searchable attributes are ranked by the best-matched attribute (depending on the order of searchable attributes). If you set attributeCriteriaComputedByMinProximity
to true
, the matched attribute is selected based on minimum proximity.
For example, consider an index of books with searchable attributes for title
, author
, and description
(in that order), and where you’ve changed the ranking formula so that Attribute comes before Proximity. If the search for a book matches on both its title
, with a proximity of 6, and description
, with a proximity of 1, then title
is the best-matched attribute even though description
has a better proximity score. Setting attributeCriteriaComputedByMinProximity
to true
computes the best-matched attribute based on minimum proximity; in this case, description
is used instead of title
.
Examples
Sets attributeCriteriaComputedByMinProximity to true for an index
1
2
3
$index->setSettings([
'attributeCriteriaComputedByMinProximity' => true
]);