Try our conversational search powered by Generative AI!

Loading...
Area: Optimizely Search & Navigation
ARCHIVED This content is retired and no longer maintained. See the latest version here.

Recommended reading 

Filtering extensions

Below are the built-in filtering extensions with usage examples.

ExcludeDeleted

Excludes all content that was moved to the trash (recycle bin).

 Note: This method is important because, by default, content in the trash is indexed.

C#
SearchClient.Instance.Search<IContent>().ExcludeDeleted()

PublishedInCurrentLanguage

Checks if content is published in the current language.

C#
SearchClient.Instance.Search<IContent>().PublishedInCurrentLanguage()

CurrentlyPublished

Checks if content is currently published in any language.

C#
SearchClient.Instance.Search<IContent>().CurrentlyPublished()

FilterOnReadAccess

Filters content to which the end user does not have access. This method uses VirtualRoleRepository, which includes users, roles, and visitor groups.

C#
SearchClient.Instance.Search<IContent>().FilterOnReadAccess()

FilterForVisitor

Group of filters including ExcludeDelete, PublishedInCurrentLanguage, and FilterOnReadAccess.

C#
SearchClient.Instance.Search<IContent>().FilterForVisitor()
Do you find this information helpful? Please log in to provide feedback.

Last updated: Nov 16, 2015

Recommended reading