alternativesAsExact

Type: list of strings
Engine default: ["ignorePlurals", "singleWordSynonym"]
Parameter syntax
'alternativesAsExact' => [
  'ignorePlurals',
  'singleWordSynonym',
  'multiWordsSynonym'
]
Parameter syntax
alternativesAsExact: [
  'ignorePlurals',
  'singleWordSynonym',
  'multiWordsSynonym'
]
Parameter syntax
alternativesAsExact: [
  'ignorePlurals',
  'singleWordSynonym',
  'multiWordsSynonym'
]
Parameter syntax
'alternativesAsExact': [
  'ignorePlurals',
  'singleWordSynonym',
  'multiWordsSynonym'
]
Parameter syntax
"alternativesAsExact": [
  "ignorePlurals",
  "singleWordSynonym",
  "multiWordsSynonym"
]
Parameter syntax
new JSONObject()
  .put(
    "alternativesAsExact",
    new JSONArray()
      "ignorePlurals",
      "singleWordSynonym",
      "multiWordsSynonym"
  )
Parameter syntax
dynamic settings = new JObject();
settings.alternativesAsExact = new JArray()
  .put("ignorePlurals")
  .put("singleWordSynonym")
  .put("multiWordsSynonym");
Parameter syntax
new IndexSettings()
  .setAlternativesAsExact(
    Arrays.asList(
      "ignorePlurals",
      "singleWordSynonym",
      "multiWordsSynonym"
    )
  )
Parameter syntax
"alternativesAsExact": []string{
  "ignorePlurals",
  "singleWordSynonym",
  "multiWordsSynonym"
},
Parameter syntax
alternativesAsExact = Some(Seq(
  "ignorePlurals",
  "singleWordSynonym",
  "multiWordsSynonym"
))

Can be used in these methods:
search, browse, searchForFacetValues, generateSecuredApiKey, addApiKey, updateApiKey search, browse, search_for_facet_values, generate_secured_api_key, add_api_key, update_api_key search, browse, searchForFacetValues, generateSecuredApiKey, addApiKey, updateApiKey search, browse, search_for_facet_values, generate_secured_api_key, add_api_key, update_api_key search, browse, searchForFacetValues searchAsync, browseAsync, searchForFacetValues Search, Browse, SearchForFacetValues, GenerateSecuredApiKey, AddApiKey, UpdateApiKey Search, browse, searchForFacetValues, generateSecuredApiKey, addApiKey, updateApiKey Search, Browse, SearchForFacetValues, GenerateSecuredAPIKey, AddAPIKey, UpdateAPIKey search, browse index, search into facet values, generateSecuredApiKey, add key, update key

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

<?php
$index->setSettings([
  'alternativesAsExact' => [
    'ignorePlurals',
    'singleWordSynonym'
  ]
]);
index.set_settings({
  alternativesAsExact: [
    'ignorePlurals',
    'singleWordSynonym'
  ]
})
index.setSettings({
  alternativesAsExact: [
    'ignorePlurals',
    'singleWordSynonym'
  ]
});
index.set_settings({
  'alternativesAsExact': [
    'ignorePlurals',
    'singleWordSynonym'
  ]
})
index.setSettings([
  "alternativesAsExact": [
    "ignorePlurals",
    "singleWordSynonym"
  ]
])
index.setSettings(
  new JSONObject()
    .put(
      "alternativesAsExact",
      new JSONArray()
        .put("ignorePlurals")
        .put("singleWordSynonym")
    )
);
dynamic settings = new JObject();
settings.alternativesAsExact = new JArray()
  .put("ignorePlurals")
  .put("singleWordSynonym");

index.SetSettings(settings);
index.setSettings(
  new IndexSettings().setAlternativesAsExact(Arrays.asList(
    "ignorePlurals",
    "singleWordSynonym"
  ))
);
res, err := index.SetSettings(algoliasearch.Map{
  "alternativesAsExact": []string{
    "ignorePlurals",
    "singleWordSynonym",
  },
})
client.execute {
  changeSettings of "myIndex" `with` IndexSettings(
    alternativesAsExact = Some(Seq(
      "ignorePlurals",
      "singleWordSynonym"
    ))
  )
}
<?php
$results = $index->search('query', [
  'alternativesAsExact' => ['multiWordsSynonym']
]);
results = index.search('query', {
  alternativesAsExact: ['multiWordsSynonym']
})
index.search({
  query: 'query',
  alternativesAsExact: ['multiWordsSynonym']
}).then(res => {
  // console.log(res);
});
results = index.search('query', {
  'alternativesAsExact': ['multiWordsSynonym']
})
let query = Query(query: "query")
query.alternativesAsExact = [.multiWordsSynonym]

index.search(query, completionHandler: { (res, error) in
  print(res)
})
index.search(
  new Query("query")
    .setAlternativesAsExact(
      new AlternativesAsExact[]{
        AlternativesAsExact.MULTI_WORDS_SYNONYM
      }
    )
);
index.search(
  new Query("query")
    .AlternativesAsExact("multiWordsSynonym")
);
index.search(
  new Query("query")
    .setAlternativesAsExact(
      Arrays.asList(
        "multiWordsSynonym"
      )
    )
);
res, err := index.Search("query", algoliasearch.Map{
  "alternativesAsExact": []string{"multiWordsSynonym"},
})
client.execute {
  search into "myIndex" query Query(
    query = Some("query"),
    alternativesAsExact = Some(Seq("multiWordsSynonym"))
  )
}
Php small white
PHP
Ruby small white
Ruby
Javascript small white
JavaScript
Python small white
Python
Swift small white
iOS
Android small white
Android
Csharp small white
C#
Java small white
Java
Go small white
Go
Scala small white
Scala
Php small white
PHP
Ruby small white
Ruby
Javascript small white
JavaScript
Python small white
Python
Swift small white
iOS
Android small white
Android
Csharp small white
C#
Java small white
Java
Go small white
Go
Scala small white
Scala