Configuring Language Settings
On this page
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.
Configuring index and query languages
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, follow these steps:
- Go to the Index page in the Algolia dashboard.
- Select the index that you want to configure.
-
Go to Configuration.
- Under Relevance Optimizations, click Language.
- To add an indexing language, go to the Index Languages section and click Select one or more languages.
- To add a query language, go to the Query Languages section and click Select one or more languages.
-
Check the option Ignore plurals to treat plural and singular queries equally. For example, the query
foot
andfeet
should return the same results. - Review and save the configuration.
You can add your own custom plurals and other declensions to a dictionary.
Configuring stop words
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, follow these steps:
- Go to the Index page in the Algolia dashboard.
- Select the index that you want to configure.
- Go to the Configuration tab.
- In the Relevance Optimizations section, select Stop Words
-
If you want to remove stop words, such as “if”, “a”, or “at” from the query, set the Remove stop words option.
Algolia uses stop word dictionaries for every query language. You can add more stop words to the dictionary.
Configuring word segmentation
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. If you use one of these languages as the query language, word segmentation is turned on by default.
If you want to index compound words in one or more of your searchable attributes as separate words, follow these steps:
- Go to the Index page in the Algolia dashboard.
- Select the index that you want to configure.
- Go to the Configuration tab.
- In the Relevance Optimizations section, select Segmentation.
- In the Decompounded Attribute section, select a language and click Add an attribute.
- Select an attribute from the list. If you can’t find the attribute you want to add, make sure you declared it as a searchable attribute.
Compound words that are in a decompounded attribute are indexed separately. The same compound word in another attribute are 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.
Adding synonyms
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 AI Synonym Suggestions dynamically 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.