lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <hossman_luc...@fucit.org>
Subject Re: Error reading documents from file index lucene 2.0
Date Fri, 16 Jun 2006 21:10:14 GMT

:         Hits hits = indexSearcher.search(query);
:         indexSearcher.close();
:         System.out.println("Hits found:" + hits.length());
:         Iterator<Hit> i = hits.iterator();

It's not legal to use an instance of Hits returned from a Searcher after
that Searcher has been closed.  The reason it may work sometimes with a
small number of documents is that Hits does some caching that makes it
unneccessary to reuse the searcher.

I'm not sure why it works with a RAMDirectory ... maybe close is a is a
NOOP in that case?

-Hoss


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