lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grant Ingersoll <gsing...@apache.org>
Subject Re: ReadOnly IndexReaders
Date Mon, 01 Jun 2009 21:58:10 GMT

On Jun 1, 2009, at 5:40 AM, Yonik Seeley wrote:

>> On May 30, 2009, at 13:27, Mark Miller <markrmiller@gmail.com> wrote:
>>> Is there a valid use case? It seems like it might be a tricky  
>>> method,
>>> because its an IndexReader property and not the index.
>>
>> But it's just a flag passed in
>>
>> If you know it's read only and that there are no deletes, can't you  
>> avoid
>> isDeleted all together?
>
> If you know there are no deletes, you should be able to avoid calling
> isDeleted anyway.

But someone could call delete on the reader if it isn't read-only.   
The case I have is I'm writing a library that takes in an IndexReader  
and then I'm going to be iterating over the documents.  My thinking,  
and it may be faulty, is that if I know there are no deletes and the  
IR is read-only, I can eliminate the isDeleted() check.  Not likely a  
big deal until we're talking lots and lots of docs.

-Grant

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


Mime
View raw message