The same here: I often have code that needs to get *all* documents out of an IndexReader (excluding deleted docs). Currently this is coded like the example from Ian.
This is often code that checks content of indexes or iterates over all documents without any Query. A better API may be good. Uwe ----- Uwe Schindler H.-H.-Meier-Allee 63, D-28213 Bremen http://www.thetaphi.de eMail: u...@thetaphi.de > -----Original Message----- > From: Ian Lea [mailto:ian....@gmail.com] > Sent: Monday, January 26, 2009 11:55 AM > To: java-user@lucene.apache.org > Subject: Re: IndexReader.isDeleted > > Hi Mike > > > I've got some applications that use lucene purely as a place to store > data, with no searching other than by product id, and have programs > that get all the data out of the store by code like > > for (int i = 0; i < max; i++) { > if (!reader.isDeleted(i)) { > Document doc = reader.document(i); > ... > } > > The index has regular updates and occasional optimizes so normally > does contain deleted docs. > > If the isDeleted() method was removed it would only be a minor > inconvenience - I'd be happy to code to any new API calls, or change > the method to call optimize first, or whatever. > > > > -- > Ian. > ian....@gmail.com > > > On Fri, Jan 23, 2009 at 8:25 PM, Michael McCandless > <luc...@mikemccandless.com> wrote: > > We are considering replacing the current random-access > > IndexReader.isDeleted(int docID) method with an iterator & skipTo > > (DocIdSet) access that would let you iterate through the deleted > > docIDs, instead. > > > > At the same time we would move to a new API to replace > > IndexReader.document(int docID) that would no longer check whether the > > document is deleted. > > > > This is being discussed now under several Jira issues and on > > java-dev. > > > > Would this be a problem for any Lucene applications out there? > > > > How is isDeleted used today (outside of Lucene)? Normally an > > IndexSearcher would never return a deleted document, and so "in > > theory" a deleted docID should never "escape" Lucene's APIs. > > > > So I'm curious what applications in fact rely on isDeleted, and how > > that method is being used... > > > > Thanks, > > > > Mike > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org > For additional commands, e-mail: java-user-h...@lucene.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org