alternativesAsExact
'alternativesAsExact' => [ 'ignorePlurals', 'singleWordSynonym', 'multiWordsSynonym' ]
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,
GenerateSecuredApiKeys,
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
Alternatives of query words that should be considered as exact matches by the Exact ranking criterion.
This setting controls what matches should be considered exact matches by the Exact ranking criterion. With the default settings, singular and plural forms of a word (ignorePlurals
), and single-word synonyms (singleWordSynonym
) are considered exact matches.
For more information, see:
Options
|
Plurals and similar declensions added by the |
|
Single-word synonyms are considered exact matches (for example, “NY” = “NYC”). |
|
Multiple-words synonyms are considered exact matches (for example, “NY” = “New York”). |
Examples
Override the default alternativesAsExact
for the current search
1
2
3
$results = $index->search('query', [
'alternativesAsExact' => ['multiWordsSynonym']
]);
Reset the default alternativesAsExact
1
2
3
4
5
6
$index->setSettings([
'alternativesAsExact' => [
'ignorePlurals',
'singleWordSynonym'
]
]);