lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: Confused about boolean query and how an IndexReader is associated with Hits
Date Wed, 07 Dec 2005 08:05:45 GMT

On Dec 7, 2005, at 2:38 AM, Alan Chandler wrote:
> Worse than that, when I attempt to access Hits.doc(0) I am getting an
> immediate IOException with the message "Bad file descriptor".  I  
> think this
> must be because by that time I have closed the indexSearcher (and  
> therefore
> the Reader that sat behind it).  Its not clear to me how hits are  
> associated
> with a reader.  Is it possible to close the reader and then re-open  
> it later
> to access a document with the hit?

You must keep your IndexSearcher instance alive and well when working  
with Hits.  Hits internally uses the searcher to page through results  
- it does not keep all results in memory.  I'm not sure why you  
aren't seeing all the documents you expect, but if you package it up  
as a simple RAMDirectory-using JUnit TestCase then I'd be happy to  
run it and see.

	Erik


---------------------------------------------------------------------
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