[ https://issues.apache.org/jira/browse/LUCENE-1314?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jason Rutherglen updated LUCENE-1314: ------------------------------------- Attachment: LUCENE-1314.patch Now that we've got IndexReader.getSequentialSubReaders(), users may try to clone the sub-readers which throws the exception below. I'd like to support cloning individual segment readers because some cases require cloning on the existing segments, without reloading the new segments. The use case is realtime search where the ram index is being flushed to disk in the background and we don't need IR.clone to also open the new segments. The old segments could be acquiring deletes as the background flush to disk is occurring. I suppose I could write a hack such that a clone is performed on the multireader, then only the old segments are pulled out segments and deleted from. Attached is a method TestIndexReaderClone.testCloneSubreaders that tests individual segment reader clone. {code} java.lang.NullPointerException at org.apache.lucene.index.DirectoryIndexReader.clone(DirectoryIndexReader.java:171) at org.apache.lucene.index.DirectoryIndexReader.clone(DirectoryIndexReader.java:162) at org.apache.lucene.index.TestIndexReaderClone.testCloneSubreaders(TestIndexReaderClone.java:46) {code} > IndexReader.clone > ----------------- > > Key: LUCENE-1314 > URL: https://issues.apache.org/jira/browse/LUCENE-1314 > Project: Lucene - Java > Issue Type: New Feature > Components: Index > Affects Versions: 2.3.1 > Reporter: Jason Rutherglen > Assignee: Michael McCandless > Priority: Minor > Fix For: 2.9 > > Attachments: LUCENE-1314.patch, LUCENE-1314.patch, LUCENE-1314.patch, > LUCENE-1314.patch, LUCENE-1314.patch, LUCENE-1314.patch, LUCENE-1314.patch, > LUCENE-1314.patch, LUCENE-1314.patch, LUCENE-1314.patch, LUCENE-1314.patch, > LUCENE-1314.patch, LUCENE-1314.patch, LUCENE-1314.patch, LUCENE-1314.patch, > LUCENE-1314.patch, LUCENE-1314.patch, LUCENE-1314.patch, LUCENE-1314.patch, > LUCENE-1314.patch, lucene-1314.patch, lucene-1314.patch, lucene-1314.patch, > lucene-1314.patch, lucene-1314.patch, lucene-1314.patch, lucene-1314.patch, > lucene-1314.patch, lucene-1314.patch, lucene-1314.patch, lucene-1314.patch, > lucene-1314.patch > > > Based on discussion > http://www.nabble.com/IndexReader.reopen-issue-td18070256.html. The problem > is reopen returns the same reader if there are no changes, so if docs are > deleted from the new reader, they are also reflected in the previous reader > which is not always desired behavior. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscr...@lucene.apache.org For additional commands, e-mail: java-dev-h...@lucene.apache.org