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

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

This section describes how to delete documents froman index.

Examples

Individual documents can be deleted from the index using the IClient interfaces Delete method.

Here is an example:

C#
client.Delete<BlogPost>(42);

The above code will delete the BlogPost with ID 42. It is also possible to delete all documents that match a certain criteria defined by a filter expression. For instance, the below code will delete all documents of type BlogPost as well as those of a type inheriting from BlogPost that are tagged with Banana.

C#
client.Delete<BlogPost>(x => x.Tags.Match("Banana"));

Last updated: Jun 10, 2014