keepDiacriticsOnCharacters
""
'keepDiacriticsOnCharacters' => 'øé'
Can be used in these methods:
setSettings
set_settings
setSettings
set_settings
setSettings
setSettings
SetSettings
setSettings
SetSettings
setSettings
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 ofu
(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' => 'øé'
]);