Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more

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

When you are searching using the Client class, inheritance is supported out of the box. For example, you have two classes, User and Author. If you search for Users, you also get matching Authors back.

Examples

C#
searchResult = client.Search<User>()
    .For("John")
    .InField(x => x.Name)
    .GetResult();

var isUser = (searchResult.First is User);
//isUser IS true

var isAuthor = (searchResult.First is Author);
//isAuthor MIGHT be true

In addition, you can search over all types that implement a specific interface.

Last updated: Sep 21, 2015