Lucene delete record is not recommended?

When conducting research on deleting documents in lucene, it seemed to me that the indexReaders delete () method was used, passing in the document identifier. Now that I really need to do this, it looks like lucene does not currently support this method, and I have very little success in finding the current way to do this.

Any ideas?

+1
source share
2 answers
+1
source

Document identifiers are internal to Lucene and should never be used. They are subject to change without notice, among other issues.

How do you get document IDs? Presumably through a request? Then just delete based on this query. In addition, if you have your own unique ID field, you can do writer.DeleteDocuments(new Term("MyIDField", "ID to delete"));

+1
source

All Articles