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
.FilterForVisitor() has an overload where you can pass a language.
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()???
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 http://world.episerver.com/documentation/developer-guides/CMS/Content/icontentrepositorydatafactory-interface1/.
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.
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);
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?