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 very useful to index values that are not exposed as properties on the objects. By customizing the Client conventions, we can include just about any value that will be indexed by including delegates whose return value will be included when indexing. These delegates can use methods, extension methods and operations on the properties exposed by the indexed object.


For instance, given that we have a BlogPost class with a list of tags we 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());

We are then able to 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 will be 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: Jun 10, 2014

Recommended reading