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

Querying examples

This 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 solve other querying needs for which you previously used the built-in FindPagesWithCriteria method. The examples below illustrate common querying scenarios specific to Episerver 7/7.5 CMS. See Searching and Filtering for more filtering examples.

Filtering by category

Filtering by Author/ChangedBy

Filtering by publish date

The example below finds pages published in October 2016.

To find all pages published prior to October 2016, use the query below.

Filtering by page type

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

Filtering by Site ID

In an enterprise scenario with multiple sites, all sites use one index. To enable filtering by site ID, the return value of an IContent extension method, SiteId, is indexed. Use SiteId to filter for content from a specific site.

Do you find this information helpful? Please log in to provide feedback.

Last updated: Oct 31, 2016