Loading...
Area: Episerver Find
Applies to versions: 12 and higher
Other versions:

Querying examples

his topic describes how to work with queries in Episerver Find, as a replacement for the FindPagesWithCriteria method in Episerver CMS.

Querying scenarios

In addition to providing great, near-real-time search, Episerver Find can also be used to solve other types of querying needs for which we traditionally used the FindPagesWithCriteria method. Below are several examples illustrating common querying scenarios specific to Episerver 7/7.5 CMS. See also Searching and Filtering  for more examples related to filtering.

Filtering by category

Filtering by Author/ChangedBy

Filtering by publish date

The following example finds pages published in October 2011.

To find all pages published prior to October 2011 instead, the below query could be used.

Filtering by page type

When you use typed content, the easiest way to filter by content type is to specify the desired type in the type parameter to the Client Search method. However, in that case, pages of page types inheriting from the specified type also are matched. In other situations, you may not know what type to filter by until at runtime. In both such cases, you can filter by the IContent.ContentTypeID.

Filtering by Site ID

In an enterprise scenario, several sites all sites utilize the same index. To handle this, the return value of an extension method for IContent, named SiteId, is indexed. You can use this to filter for content on a specific site.

Last updated: Oct 31, 2016