You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Jayakumar P <Ja...@gedc.tcs.co.in> on 2002/03/13 13:51:43 UTC

Bad File Descriptor Exception

Hi all,
I'm a new user to Lucene,

I'm getting "Bad File Descriptor" Exception for the following piece of code

Hits hits = searcher.search(query); //returns hits properly
for (int i =0; i< hits.length();i++)
{
    Document doc = hits.doc(i); // throws exception "Bad Fle Descriptor"
}

can any one tell me why this happens

Regards

Jayakumar

Re: Bad File Descriptor Exception

Posted by Avi Drissman <av...@baseview.com>.
At 6:21 PM +0530 3/13/02, you wrote:

>Hits hits = searcher.search(query); //returns hits properly
>for (int i =0; i< hits.length();i++)
>{
>     Document doc = hits.doc(i); // throws exception "Bad Fle Descriptor"
>}

Are you closing the searcher between the search and the loop?

Hits objects don't contain all the results. They have about 100, and 
they a reference to the searcher so that they can get more results if 
they have to. If you close the searcher, then you will hit this type 
of behavior.

Avi

-- 
Avi Drissman
avi_drissman@baseview.com
Argh! This darn mailserver is trunca

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>