London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!

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

Introduction

When searching using the Client class inheritance is supported out of the box. In other words, if we have two classes, User and Author and we search for Users we can 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

It is also possible to search over all types that implement a specific interface.

Last updated: Apr 03, 2014