FAQ
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

Search Discussions

  • Avi Drissman at Mar 13, 2002 at 2:58 pm

    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:
    For additional commands, e-mail:

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupjava-user @
categorieslucene
postedMar 13, '02 at 12:44p
activeMar 13, '02 at 2:58p
posts2
users2
websitelucene.apache.org

2 users in discussion

Jayakumar P: 1 post Avi Drissman: 1 post

People

Translate

site design / logo © 2022 Grokbase