HomeDev guideAPI ReferenceGraphQL
Dev guideUser GuideGitHubNuGetDev CommunitySubmit a ticketLog In
GitHubNuGetDev CommunitySubmit a ticket

Locale (language routing)

Describes how to use language routing.

πŸ‘

Beta

The Optimizely Graph .NET Client is in beta. Contact your Customer Success Manager for information.

Language routing is helpful for your search requests because it gets results faster and more accurately. It filters the content by routing to the specified language content. Language routing also uses linguistic processing of content when using the contains operator on a field. See Optimizely Graph's locale parameter.

In the Optimizely Graph .NET Client, the Locale and Locales methods are used for routing to the specified language or languages content.

Localemethod

The parameters for the method can be an EPiServer.ContentGraph.Api.LocaleMode enum with two options:

  • ALL – For all indices.
  • NEUTRAL – For standard index.
var query = queryBuilder
.ForType<MyDocumentType>()
  .Locale(LocaleMode.NEUTRAL)
  .Fields(x=>x.Property)
.ToQuery()
.BuildQueries();

Locales method

Use this method if you want to route to some languages. The parameters are an array of System.Globalization.CultureInfo.

var query = queryBuilder
.ForType<MyDocumentType>()
  .Locales(new CultureInfo(β€œen”), new CultureInfo(β€œsv”))
  .Fields(x=>x.Property)
.ToQuery()
.BuildQueries();