---
title: Language-specific queries
slug: cms-12/docs/language-specific-queries
docTags: 
createdAt: 2026-08-10T15:56:02.000Z
---

When you set up an index, you define the languages it supports. When searching a defined language, you use the `Client` class and the `Search` extension method, and pass to the `Search` extension method an instance of the `Language` class.

Optimizely Search & Navigation also has a [Language routing](docId\:YBXL-GFVYzztjHpomeD1p) feature that lets you limit search queries to documents in a specified language.

This feature is not enabled by default. You enable it by setting `EnableLanguageRoutingInSearchRequest` to `true` in the `Find` configuration section. This setting will enable `language-routing` for both `search` and `msearch` queries. See [Improve performance by enabling language routing on search requests](https://world.optimizely.com/blogs/dada/dates/2023/4/enable-language-routing-for-search-requests/) (blog post by Daniel Dahlin) for more details.

```csharp
"Find": {
  "DefaultIndex": "your_index",
  "ServiceUrl": "find_service_url",
  "EnableLanguageRoutingInSearchRequest": true
}
```

Optimizely Search & Navigation exposes an instance for each supported language as a static property on the `Language` class.

```csharp
client.Search<BlogPost>(Language.Swedish)
    .For("turtles")
    .InField(x => x.Title);
```

For `msearch` queries (available from version 16.6.0):

```csharp
client.MultiSearch<BlogPost>(Language.English)
  .Search(s => s.For("tiger").InField(x => x.Title))
  .Search(s => s.For("bear").InField(x => x.Title));
//or
client.MultiSearch<BlogPost>()
  .Search(s => s.For("tiger").InField(x => x.Title))
  .Search(s => s.For("bear").InField(x => x.Title))
  .LanguageRouting(Language.English);
//or
client.MultiUnifiedSearch()
  .UnifiedSearch(s => s.For("tiger"))
  .UnifiedSearch(s => s.For("bear"))
```

:::hint{type="info"}
- **Note**
  If you using `MultiUnifiedSearch` the search request uses `LanguageCulture` in a `msearch` context for language routing, if `LanguageCulture` is not specified, `PreferredCulture` becomes the default language routing. You can override this by chaining`LanguageRouting(Language.English)`method to the query builder.
- You can search all languages by using `LanguageRouting(Language.All)` or `LanguageRouting(Language.None)`.
:::

The language parameter only applies when specifying one or more fields to search. If you do not select fields, Optimizely Search & Navigation searches over the special `_all` field, which supports only a single analyzer. Likewise, it uses the standard analyzer when searching attachments (Word documents, PDFs, and so on).

When a language is specified, the search applies stemming tailored to that language. Consequently, when you include a `language` parameter, Optimizely Search & Navigation provides results across all languages and for *stemmed* words in the specified language. To restrict results to a particular language,  use a [filter](docId\:lp43UeoIMhZUe5iubyEWz) (such as, `FilterForVisitor`).
