disableExactOnAttributes
[]
'disableExactOnAttributes' => [ 'attribute', ... ]
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
List of attributes on which you want to disable the exact
ranking criterion.
Usage notes
- The list must be a subset of the
searchableAttributes
index setting. - The
searchableAttributes
setting must not be empty nor null fordisableExactOnAttributes
to be applied. - This attribute is useful for longer or noisy attributes like “description” or “content”. In these attributes the
exact
ranking criterion can play an outsized role because matches can be alternative versions of query terms. When exact matches do occur in these attributes, the engine boosts these records though they might not be more relevant than those with non-exact matches. Disablingexact
on these attributes can reduce these false positives without having to disableexact
for the entire search. - Conversely, disabling
exact
on succinct or precise attributes like “keywords” generally doesn’t help relevance, since matches are more likely to be exact between queries and these attributes.
Examples
Disable exact ranking criterion for some attributes by default
1
2
3
4
5
$index->setSettings([
'disableExactOnAttributes' => [
'description',
]
]);
Disable exact ranking criterion for some attributes for the current search
1
2
3
4
5
$results = $index->search('query', [
'disableExactOnAttributes' => [
'description'
]
]);