Resources

Configuring Language Settings

The handling of typos, stop words, or plurals depends on the language. To ensure that your relevance configuration supports the language your data is in (index languages) and the language your users use to search (query languages), it’s important to adjust the language settings.

The language settings affect both your data (indexing language) as well as the search queries (query languages), for example, splitting the query into words (tokenization), or the treatment of plurals.

To change the settings appropriate for the language you want to support:

  1. Go to the Index page in the Algolia dashboard.
  2. Select the index that you want to configure.
  3. Go to Configuration.
    Index
  4. Under Relevance Optimizations, click Language.
  5. To add an indexing language, go to the Index Languages section and click Select one or more languages.
  6. To add a query language, go to the Query Languages section and click Select one or more languages.
  7. Check the option Ignore plurals to treat plural and singular queries equally. For example, the query  foot  and  feet  should return the same results.
    Index languages
  8. Review and save the configuration.

You can add custom plurals and other declensions to a dictionary.

Stop words are common words that don’t add much information, such as articles, prepositions, or conjunctions. They’re filtered out from every search. To configure stop words:

  1. Go to the Index page in the Algolia dashboard.
  2. Select the index that you want to configure.
  3. Go to the Configuration tab.
  4. In the Relevance Optimizations section, select Stop Words
  5. If you want to remove stop words, such as “if”, “a”, or “at” from the query, set the Remove stop words option.
    Optional words

Algolia uses stop word dictionaries for every query language. You can add more stop words to the dictionary.

When users search with a compound word, Algolia segments the compound word into its constituents and searches for the individual words instead. This returns more results for languages with many compound words. Algolia supports segmenting compound words in Dutch, German, Finnish, Danish, Swedish, and Norwegian Bokmål. Word segmentation is turned on by default if you use one of these languages as the query language,

If you want to index compound words in one or more of your searchable attributes as separate words:

  1. Go to the Index page in the Algolia dashboard.
  2. Select the index that you want to configure.
  3. Go to the Configuration tab.
  4. In the Relevance Optimizations section, select Segmentation.
  5. In the Decompounded Attribute section, select a language and click Add an attribute.
  6. Select an attribute from the list. If you can’t find the attribute you want to add, make sure you have declared it as a searchable attribute.

Compound words that are in a decompounded attribute are indexed separately. The same compound word in another attribute is indexed as one word.

Algolia uses dictionaries for every query language to determine word segmentation. You can add compound words to the dictionary and decide if you want to segment them or keep them as one word when searching. In some scenarios, it’s better to keep compound words, for example, when searching for brand names.

Synonyms let your users use different words to search for the same products. For example, some users look for “pants”, while others might search for “trousers”—both meaning the same. If you add “pants” and “trousers” as synonyms, both searches return the same results.

Algolia’s Dynamic Synonym Suggestions suggest synonyms based on your users’ searches. You can also add synonyms manually, based on your internal business data. For example, if you’re working in a field with a lot of industry-specific terminology, you can use this information to ensure your users always find what they’re looking for.