lucy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Karman <pe...@peknet.com>
Subject Re: [lucy-user] Hits offset and search performarce
Date Tue, 13 Nov 2012 17:47:25 GMT
On 11/13/12 11:33 AM, Marvin Humphrey wrote:

>
> I would oppose a seek() which runs implicit searches behind the scenes because
> it would surprise users with a hidden performance cost.
>

I was imagining that $hits->seek() would just adjust the iterator 
pointer, like a shortcut for this pseudo-code:

  sub seek {
      my ($hits, $new_pos) = @_;
      # some error check here to verify $new_pos
      # isn't beyond the offset+num_wanted
      while ($hits->current_pos < $new_pos) {
          $hits->next or last;
      }
  }


-- 
Peter Karman  .  http://peknet.com/  .  peter@peknet.com

Mime
View raw message