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

Can be used in these methods:

About this parameter

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

Set default alternativesAsExact

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