lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Reg <register9...@gmail.com>
Subject TrackingIndexWriter.tryDeleteDocument(IndexReader, int) vs deleteDocuments(Query)
Date Tue, 07 May 2013 01:05:59 GMT
Hi all,

It seems tryDeleteDocument(IndexReader, int) doesn't work with NRTManager
while deleteDocuments(Query) works.

Here are some sample code snippets:

TrackingIndexWriter mgrWriter = new NRTManager.TrackingIndexWriter(writer);

ReferenceManager<IndexSearcher> mgr = new NRTManager(mgrWriter, new
SearcherFactory(), true);

mgrWriter.tryDeleteDocument(DirectoryReader.open(writer, true), 0);

mgr.maybeRefresh();

IndexSearcher searcher = mgr.acquire();

searcher.search(query, collector);


The deleted doc with id 0 is still returned in collector, but I don't see
such issues if I change to mgrWriter.deleteDocuments(Query).

Any ideas?

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message