lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <cutt...@apache.org>
Subject Re: IllegalArgumentException: attempt to access a deleted document
Date Fri, 07 Oct 2005 04:48:14 GMT
Peter Kim wrote:
> I noticed one way to get around this is to use IndexReader.isDeleted()
> to check if it's deleted or not. The problem with that is I only have
> access to a MultiSearcher in my HitCollector which doesn't give me
> access to the underlying IndexReader. I don't want to have to open an
> IndexReader in my custom hit collector to use its isDeleted() method.

Check out the MultiSearcher methods subSearcher() and subDoc().  If you 
keep an array of the IndexReaders that your MultiSearcher searches, then 
you can use:

readers[searcher.subSearcher(doc)].isDeleted(searcher.subDoc(doc))

Hope that helps.

Doug

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message