lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marvin Humphrey <mar...@rectangular.com>
Subject Re: Controlling Hits
Date Sat, 25 Nov 2006 07:14:03 GMT

On Nov 24, 2006, at 10:38 PM, Otis Gospodnetic wrote:

> Could we make Hits non-final, or at least expose something in Hits  
> to control the number of Documents it reads from disk?
> I'm looking at:
>   getMoreDocs(50); // retrieve 100 initially
> ...
>   int n = min * 2;    // double # retrieved
> (Why * 2?  To "read and cache ahead"?)
>
> ... and wondering how I could control those two numbers.  If  
> reading Documents out of the index is the thing to minimize, then  
> by changing/decreasing that 50 and maybe eliminating that * 2, I  
> would hit my disk a little less, no?  Maybe something as simple as  
> this will do:
>
>   public static void fetchDocs(int)

FWIW, in KinoSearch, this is the interface:

   my $hits = $searcher->search( query => $query );
   $hits->seek( $offset, $num_wanted );
   while ( my $hit = $hits->fetch_hit_hashref ) {
        print "$hit->{title}\n";
   }

The actual scoring doesn't happen until seek() gets called.  That  
way, it's possible to know exactly how many hits need to be  
collected, by adding $offset and $num_wanted.

Marvin Humphrey
Rectangular Research
http://www.rectangular.com/



---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message