ignorePlurals
, which treats the singular and plural forms of a word as equivalent (they match even if they’re spelled differently).removeStopWords
, which prevents stop words from being processed as a part of the query. English stop words include “the”, “a”, “an”, “and”. UsequeryLanguages
to set the languages that these parameters use to determine stop words or plurals.
You should always set
queryLanguages
and indexLanguages
for your indices. If you don’t, the engine uses either the default (all supported languages) or the list of languages specified in ignorePlurals
and removeStopWords
.
This can lead to unexpected search results.Set the index language in the dashboard
- Go to the Algolia dashboard and select your Algolia application.
- On the left sidebar, select Algolia Search Search.
-
Select your Algolia index:
- On the Configuration tab, click Language.
-
Click Select one or more languages under the Query Languages section, and enter your desired language. You can enter as many languages as you want.
Likewise, you can also set
ignorePlurals
andremoveStopWords
in the Algolia dashboard. - Save your changes.
Set the index language with the API
To set an index’s language through the API, use thesetSettings
method.
In the following example, queryLanguages
is set to English and ignorePlurals
is set to true
. This means “mice” and “mouse” are treated as equal.