O'Reilly logo

Instant Lucene.NET by Michael Heydt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Deleting documents from an index (Should know)

There are times when you may need to remove a document from an index. One such case might be if you are implementing a front end similar to SharePoint that allows users to add and remove documents from content libraries that are implemented by a Lucene.NET index. If a user removes a document, it will need to have no effect on future search result scoring or be in the search results.

How to do it…

The primary means of deleting documents from an index is through the DeleteDocuments method of the IndexWriter class. There are several overloads of this method, but the basic idea is that, given a term, query, or an array of either, the IndexWriter object will delete all entries from the index matching those ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required