API Reference / API Parameters / separatorsToIndex
Type: string
Engine default: "" (separators are not indexed)
Parameter syntax
'separatorsToIndex' => 'separators'

Can be used in these methods:

About this parameter

Control which non-alphanumeric characters are indexed.

By default, Algolia ignores non-alphanumeric characters such as hyphen (-), plus (+), and parentheses ((,)). To include such characters, define them with separatorsToIndex.

Usage notes

  • Separators must be non-letter characters such as: !#()[]{}*+-_一,:;<>?@/\^|%&~£¥$§€`"'‘’“”†‡
  • Separators may not be spaces or currency characters, such as $€£¥
  • Algolia treats separator characters as separate words. For example, in a search for “Disney+”, Algolia considers “Disney” and “+” as two separate words, and counts as a match on two words in getRankingInfo.

Examples

Create a list of non-alphanumeric characters to index

To search for “+33”, “Disney+”, or “C#”, include + and # in separatorsToIndex.

1
2
3
$index->setSettings([
  'separatorsToIndex' => '+#'
]);
Did you find this page helpful?