/[mws]/trunk/lib/MWS/SWISH.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/MWS/SWISH.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 16 by dpavlin, Thu May 6 23:06:08 2004 UTC revision 17 by dpavlin, Fri May 7 11:25:01 2004 UTC
# Line 48  sub search_index { Line 48  sub search_index {
48          print STDERR "swish search: $s\n";          print STDERR "swish search: $s\n";
49          my $results = $index->Query($s);          my $results = $index->Query($s);
50    
51            # store total number of hits
52            $self->{'total_hits'} = $results->Hits;
53    
54          my @res_ids;          my @res_ids;
55    
56            my $count = 0;
57    
58          while ( my $r = $results->NextResult ) {          while ( my $r = $results->NextResult ) {
59    
60                  sub p($$) {                  sub p($$) {
# Line 72  sub search_index { Line 77  sub search_index {
77    
78                  # this is redundant, but needed for templates later...                  # this is redundant, but needed for templates later...
79                  $self->{cache}->{$id}->{'id'} = $id;                  $self->{cache}->{$id}->{'id'} = $id;
80    
81                    last if ($count++ > $self->{max_results});
82          }          }
83    
84          return @res_ids;          return @res_ids;

Legend:
Removed from v.16  
changed lines
  Added in v.17

  ViewVC Help
Powered by ViewVC 1.1.26