London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!

Area: Optimizely Search & Navigation
ARCHIVED This content is retired and no longer maintained. See the latest version here.

Introduction

When an index is set up you have the ability to choose a number of languages that it should support. Searching in one of these languages using the Client class and the Search extension method is straight forward. Simply pass the Search extension method an instance of the Language class.

Examples

An instance for each supported language is exposed as a static property on the Language class.

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

Note that the language parameter only makes a difference when specifying one or multiple fields to search in. When searching without specifying any field the search is made over the special _all field which only supports a single analyzer. Likewise, when searching in attachments (Word documents, PDFs etc) the standard analyzer is used.

Searching in a specific language means that the search is performed using stemming adapted for that language.

Last updated: Sep 26, 2013