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

Can be used in these methods:
search, setSettings, browseObjects, searchForFacetValues, generateSecuredApiKey, addApiKey, updateApiKey

About this parameter# A

List of alternatives that should be considered an exact match by the exact ranking criterion.

Options: #

  • ignorePlurals: Alternative words added by the ignorePlurals feature.

  • singleWordSynonym: Single-word synonyms (example: “NY” = “NYC”).

  • multiWordsSynonym: Multiple-words synonyms (example: “NY” = “New York”).

Examples# A

Set default alternativesAsExact#

1
2
3
4
5
6
$index->setSettings([
  'alternativesAsExact' => [
    'ignorePlurals',
    'singleWordSynonym'
  ]
]);

Override default alternativesAsExact for the current search#

1
2
3
$results = $index->search('query', [
  'alternativesAsExact' => ['multiWordsSynonym']
]);
Did you find this page helpful?
PHP v3