lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <>
Subject Re: What is a Hits object?
Date Thu, 06 Oct 2005 16:22:19 GMT

On Oct 6, 2005, at 11:28 AM, Cyril Barlow wrote:
> How long does the Hits object stay in memory for?

As long as you keep it around.  Lucene isn't responsible for keeping  
a reference to it, your application is.

> Until the IndexSearcher closes? And if you just use 1 IndexSearcher  
> would there be a big collection
> of Hits in memory?

See above.  You're entirely in charge of the Hits object being kept  
around, or not.

Since you're obviously in a servlet environment, you probably will  
want to implement some sort of paging through Hits.  One option is to  
simply throw Hits away after every request and re-search for every  
page.  That works well enough in every case I've encountered that I  
haven't used the alternative of keeping Hits around across requests.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message