Quantcast
Channel: Optimizely Search & Navigation
Viewing all articles
Browse latest Browse all 6894

Filter content by language

$
0
0

Hi Team,
I want to filter page by exiting languages . 

The below method always retrnng me null value. 

Is the any thing wrong with my query.

 public T GetPageData<T>() where T:PageData
        {
            return this.searchClient.Search<T>()
                .Filter(x => x.ExistingLanguages.Select(y => y.Name).MatchContained(z => z, "en"))
                .GetContentResult().Items.FirstOrDefault();
        }

I am using the latest verion of Find

 <package id="EPiServer.Find" version="13.0.5" targetFramework="net472" />
Regards
Phani

Viewing all articles
Browse latest Browse all 6894

Trending Articles