Try our conversational search powered by Generative AI!

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

Recommended reading 


In some situations, especially when working with classes from third party libraries, it can be useful to index values that are not exposed as properties on the objects. By customizing the Client conventions, you can include just about any value that will be indexed by including delegates whose return value is included when indexing. These delegates can use methods, extension methods, and operations on the properties exposed by the indexed object.


Given a BlogPost class with a list of tags, you can include the tag count by configuring the Client conventions to include an expression that retrieves it.

//using EPiServer.Find.ClientConventions;

    .IncludeField(x => x.Tags.Count());

You can then search and filter for the indexed value:

    .Filter(x => x.Tags.Count().Match(firstIndexedObject.Tags.Count()))

It is also possible to supply a delegate that is used to set the value when returned in a search result.

        x => x.GetSomeField(), 
        (x, value) => x.SetSomeField(value));
Do you find this information helpful? Please log in to provide feedback.

Last updated: Feb 23, 2015

Recommended reading