Algolia DevCon
Oct. 2–3 2024, virtual.
API Reference / API Parameters / keepDiacriticsOnCharacters
Type: string
Engine default: ""
Parameter syntax
'keepDiacriticsOnCharacters' => 'øé'

Can be used in these methods:

About this parameter

List of characters that the engine shouldn’t automatically normalize.

By default, the Algolia search engine normalizes all characters to their lowercase counterpart, and strips them from their diacritics. For example, "é" becomes "e", "ø" becomes "o", "で" becomes "て", and so on. This default behavior can be an issue for certain languages. This setting lets you disable automatic normalization on a given set of characters.

Usage notes

  • The setting only accepts lowercase characters, but also applies to their uppercase counterpart. For example, "Ø" is an invalid value for this setting, but specifying "ø" prevents the normalization of both "ø" and "Ø".
  • The setting only accepts characters that would be transformed otherwise. For example, "o" is considered invalid because it doesn’t have any diacritic.
  • The setting won’t work for records or queries that contain non-spacing mark Unicode characters. For example, would still be normalized if is made of u (U+0075) + ◌̈ (U+0308). But ü (U+00FC) would be preserved, as it is a single character.

Examples

Set the characters for which diacritics should be preserved

1
2
3
$index->setSettings([
  'keepDiacriticsOnCharacters' => 'øé'
]);
Did you find this page helpful?