Try our conversational search powered by Generative AI!

How can I fetch all pages with different language version by epi find query using GetContentResult() method



Can anyone help me to know  how we can fetch  all pages created with different languages version by epi find query.

My query are mentioned a s below:-

var query = SearchClient.Instance.Search().FilterForVisitor().
OrderByDescending(x => x.StartPublish).Take(1000);
var batch = query.GetContentResult();

Thanks in advance

Mar 06, 2017 13:04

.FilterForVisitor() has an overload where you can pass a language.

Mar 06, 2017 16:13

Hi Johan,

Thanks for your reply.. One more query i have..

If i want to mention/fetch all languages then what i should do ?

Should i pass all the languages in FilterForVisitor()???



Mar 07, 2017 7:03

If you remove FilterForVisitor() you will probably get all language variants. If not, you can load them manually with IContentLoader after the search, please see

Mar 07, 2017 7:53

If you remove FilterForVisitor, make sure to use  .ExcludeDeleted().CurrentlyPublished().FilterOnReadAccess() instead to make sure visitors won't see content that they are not supposed to see.

Mar 07, 2017 8:16

Hi Per and Johan,

Thanks a lot for your Help and suggestion. Realy i am very thankful to you for this.

Could you please tell me one more thing  how can i retrieve data with two languages ( English and swedish) from Epi find query.

My code is metioned below:

query = SearchClient.Instance.Search<PublicContentPage>().FilterForVisitor().Filter(MarketTagFilter).Filter(CategoryTagFilter)
.OrderByDescending(x => x.StartPublish).Take(1000);



Mar 10, 2017 15:09

Hi Guys,

i have a question regarding the FilterForVisitor() method. 

I am using Find to get products from Commerce Catalog.  I have products of Type TippingProducts in the catalog.  Each product can be published in couple of languages. (en, en-US, nl-NL etc). 

Now in the master language en, there are 20 products, all published.  Using the method below(without language) i get them all. 

in en-US for example of those 20, only 3 are translated and published. The other 17 i dont want to show in en-US. 

But still when calling the FilterForVisitor("en-US"), i get no results.  The same goes for FilterForVisitor("nl-NL") (no results). 

What am i doing wrong here?  I am on the latest of all packages of Find en EPi/Commerce of today. 

var query = client.Search<TippingProduct>()

If FilterForVisitor is not working, any other workaround to get only the TippingProducts given a specific culture?

Sep 15, 2018 13:14
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.