/[Grep]/lib/Grep/Search.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 /lib/Grep/Search.pm

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

revision 136 by dpavlin, Thu May 3 15:39:52 2007 UTC revision 141 by dpavlin, Tue May 8 12:37:28 2007 UTC
# Line 3  package Grep::Search; Line 3  package Grep::Search;
3  use strict;  use strict;
4  use warnings;  use warnings;
5  use base qw( Class::Accessor );  use base qw( Class::Accessor );
6  Grep::Search->mk_accessors( qw( invindexer create index_path ) );  Grep::Search->mk_accessors( qw( invindexer create index_path hits ) );
7    
8  use Data::Dump qw/dump/;  use Data::Dump qw/dump/;
9  use KinoSearch::InvIndexer;  use KinoSearch::InvIndexer;
# Line 117  sub add { Line 117  sub add {
117    
118  =head2 collection  =head2 collection
119    
120    Return C<Grep::Model::ItemCollection> which is result of C<search query>
121    
122    my $ItemCollection = $search->collection( 'search query' );    my $ItemCollection = $search->collection( 'search query' );
123    
124    =head2 hits
125    
126    Return number of results from last C<collection> call
127    
128      my $num_results = $search->hits;
129    
130  =cut  =cut
131    
132  sub collection {  sub collection {
# Line 139  sub collection { Line 147  sub collection {
147  #               num_wanted      => $hits_per_page,  #               num_wanted      => $hits_per_page,
148          );          );
149    
150          my $num_hits = $hits->total_hits;          $self->hits( $hits->total_hits );
151    
152          $self->log->debug("found $num_hits results");          $self->log->debug("found ", $self->hits, " results");
153    
154          my $collection = Grep::Model::ItemCollection->new();          my $collection = Grep::Model::ItemCollection->new();
155    

Legend:
Removed from v.136  
changed lines
  Added in v.141

  ViewVC Help
Powered by ViewVC 1.1.26