Jagadesh
Jagadesh

Reputation: 6807

Delete not working in lucene indexing (3.5.0)

I am using lucene 3.5.0. I used IndexWriter.deleteDocuments(new Term(field, value)) to delete the index. I performed a delete and there were no exceptions. But still I could find the Lucene document of the particular field while I search. I am able see the document values in the index file(.fdt file) in the file system. How to crosscheck it?

Upvotes: 0

Views: 313

Answers (1)

Kai Chan
Kai Chan

Reputation: 2473

Have you called IndexWriter's commit() or close() after calling deleteDocuments(Term)? Deletions are not visible to IndexReader (and therefore IndexSearcher) until either commit() or close() is called.

Upvotes: 1

Related Questions