> ## Documentation Index
> Fetch the complete documentation index at: https://algolia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Set an index's query language

> Learn how to set an index's query language through the dashboard and the API.

export const Application = () => <Tooltip tip="An Algolia application is a self-contained environment with its own indices, configuration, and API keys. Applications don't share data or settings with each other.">
    application
  </Tooltip>;

export const AlgoliaSearch = () => <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80" width="20" height="20" className="inline" fill="none" role="presentation" ariaLabel="Algolia Search">
    <circle cx="40" cy="32" r="28" fill="#5468FF"></circle>
    <rect x="30" y="22" width="20" height="20" rx="10" fill="#fff"></rect>
    <path d="M43 63.5 54.5 60l6 17h-12L43 63.5Z" fill="#36395A"></path>
  </svg>;

Most of Algolia's textual matching is language agnostic, meaning **the matching and ranking processes are the same for every language**. If a search textually matches a record, that record is returned. This approach ensures that Algolia works for any language without any extra customization.

However, there are circumstances where knowledge of the query language is vital for accurate search.
For example, by identifying your query language, **you can treat plurals and singulars as equivalent**.
If your users search for "mice", you most likely don't want to treat the singular "mouse" as a typo.

Two parameters rely on query language:

* [`ignorePlurals`](/doc/api-reference/api-parameters/ignorePlurals),
  which treats the singular and plural forms of a word as equivalent (they match even if they're spelled differently).
* [`removeStopWords`](/doc/api-reference/api-parameters/removeStopWords), which prevents stop words from being processed as a part of the query.
  English stop words include "the", "a", "an", "and".
  Use [`queryLanguages`](/doc/api-reference/api-parameters/queryLanguages) to set the languages that these parameters use to determine stop words or plurals.

<Note>
  You should always set [`queryLanguages`](/doc/api-reference/api-parameters/queryLanguages) and [`indexLanguages`](/doc/api-reference/api-parameters/indexLanguages) for your indices. If you don't, the engine uses either the default (all [supported languages](/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/supported-languages)) or the list of languages specified in [`ignorePlurals`](/doc/api-reference/api-parameters/ignorePlurals) and [`removeStopWords`](/doc/api-reference/api-parameters/removeStopWords).
  **This can lead to unexpected search results.**
</Note>

## Set the index language in the dashboard

1. Go to the [Algolia dashboard](https://dashboard.algolia.com/explorer/browse) and select your Algolia <Application />.

2. On the left sidebar, select <AlgoliaSearch /> **Search**.

3. Select your Algolia index:

   <img src="https://mintcdn.com/algolia/QUuhkPGiow1bP-ae/images/guides/relevance/select-index.png?fit=max&auto=format&n=QUuhkPGiow1bP-ae&q=85&s=26df8c341b448854e19b5522e30bb6cc" alt="Screenshot of a dashboard interface showing 'Application' with 'demo' selected and 'Index' with 'example-index' selected." width="680" height="116" data-path="images/guides/relevance/select-index.png" />

4. On the **Configuration** tab, click **Language**.

5. 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`](/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/how-to/customize-plurals-and-other-declensions#using-the-dashboard) and [`removeStopWords`](/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/how-to/customize-stop-words) in the Algolia dashboard.

6. Save your changes.

## Set the index language with the API

To run the code examples on this page, [install the latest API client](/doc/libraries/sdk/install).
To set an index's language through the API, use the [`setSettings`](/doc/libraries/sdk/v1/methods/set-settings) method.

In the following example, [`queryLanguages`](/doc/api-reference/api-parameters/queryLanguages) is set to English and [`ignorePlurals`](/doc/api-reference/api-parameters/ignorePlurals) is set to `true`.
This means "mice" and "mouse" are treated as equal.

<CodeGroup>
  ```cs C# theme={"system"}
  var response = await client.SetSettingsAsync(
    "INDEX_NAME",
    new IndexSettings
    {
      QueryLanguages = new List<SupportedLanguage> { Enum.Parse<SupportedLanguage>("En") },
      IgnorePlurals = new IgnorePlurals(true),
    }
  );
  ```

  ```dart Dart theme={"system"}
  final response = await client.setSettings(
    indexName: "INDEX_NAME",
    indexSettings: IndexSettings(
      queryLanguages: [
        SupportedLanguage.fromJson("en"),
      ],
      ignorePlurals: true,
    ),
  );
  ```

  ```go Go theme={"system"}
  response, err := client.SetSettings(client.NewApiSetSettingsRequest(
    "INDEX_NAME",
    search.NewEmptyIndexSettings().SetQueryLanguages(
      []search.SupportedLanguage{search.SupportedLanguage("en")}).SetIgnorePlurals(search.BoolAsIgnorePlurals(true))))
  if err != nil {
    // handle the eventual error
    panic(err)
  }
  ```

  ```java Java theme={"system"}
  UpdatedAtResponse response = client.setSettings(
    "INDEX_NAME",
    new IndexSettings().setQueryLanguages(Arrays.asList(SupportedLanguage.EN)).setIgnorePlurals(IgnorePlurals.of(true))
  );
  ```

  ```js JavaScript theme={"system"}
  const response = await client.setSettings({
    indexName: 'theIndexName',
    indexSettings: { queryLanguages: ['en'], ignorePlurals: true },
  });
  ```

  ```kotlin Kotlin theme={"system"}
  var response =
    client.setSettings(
      indexName = "INDEX_NAME",
      indexSettings =
        IndexSettings(
          queryLanguages = listOf(SupportedLanguage.entries.first { it.value == "en" }),
          ignorePlurals = IgnorePlurals.of(true),
        ),
    )
  ```

  ```php PHP theme={"system"}
  $response = $client->setSettings(
      'INDEX_NAME',
      ['queryLanguages' => [
          'en',
      ],
          'ignorePlurals' => true,
      ],
  );
  ```

  ```python Python theme={"system"}
  response = client.set_settings(
      index_name="INDEX_NAME",
      index_settings={
          "queryLanguages": [
              "en",
          ],
          "ignorePlurals": True,
      },
  )
  ```

  ```ruby Ruby theme={"system"}
  response = client.set_settings(
    "INDEX_NAME",
    Algolia::Search::IndexSettings.new(query_languages: ["en"], ignore_plurals: true)
  )
  ```

  ```scala Scala theme={"system"}
  val response = Await.result(
    client.setSettings(
      indexName = "INDEX_NAME",
      indexSettings = IndexSettings(
        queryLanguages = Some(Seq(SupportedLanguage.withName("en"))),
        ignorePlurals = Some(IgnorePlurals(true))
      )
    ),
    Duration(100, "sec")
  )
  ```

  ```swift Swift theme={"system"}
  let response = try await client.setSettings(
      indexName: "INDEX_NAME",
      indexSettings: IndexSettings(
          ignorePlurals: SearchIgnorePlurals.bool(true),
          queryLanguages: [SearchSupportedLanguage.en]
      )
  )
  ```
</CodeGroup>
