lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Rutherglen" <jason.rutherg...@gmail.com>
Subject IndexReader.reopen issue
Date Mon, 23 Jun 2008 14:19:18 GMT
When this code is run, why are the generation numbers the same?  The desired
behavior is that the delete happens only to the newIndexReader, leaving the
previousIndexReader unaffected.

IndexReader previousIndexReader = latestIndexSnapshot.getIndexReader();
IndexReader newIndexReader = previousIndexReader.reopen(); // returns the
same reader?
newIndexReader.deleteDocument(10);
newIndexReader.flush();
newIndexReader = newIndexReader.reopen();
LOG.info("previous reader gen:
"+previousIndexReader.getIndexCommit().getGeneration()+" newIndexReader gen:
"+newIndexReader.getIndexCommit().getGeneration());

Mime
View raw message