API Reference / API Parameters / alternativesAsExact
Type: list of strings
Engine default: ["ignorePlurals", "singleWordSynonym"]
Parameter syntax

Can be used in these methods:

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

ignorePlurals

Plurals and similar declensions added by the ignorePlurals setting are considered exact matches.

singleWordSynonym

Single-word synonyms are considered exact matches (for example, “NY” = “NYC”).

multiWordsSynonym

Multiple-words synonyms are considered exact matches (for example, “NY” = “New York”).

Examples

1
2
3
$results = $index->search('query', [
  'alternativesAsExact' => ['multiWordsSynonym']
]);

Reset the default alternativesAsExact

1
2
3
4
5
6
$index->setSettings([
  'alternativesAsExact' => [
    'ignorePlurals',
    'singleWordSynonym'
  ]
]);
Did you find this page helpful?