/[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 131 by dpavlin, Tue May 1 10:47:23 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    
# Line 192  sub finish { Line 200  sub finish {
200          return;          return;
201  }  }
202    
 =cut  
   
203  =head2 snippet  =head2 snippet
204    
205    my $short = $self->snippet( 50, $text );    my $short = $self->snippet( 50, $text );
# Line 223  package Grep::Search::Schema; Line 229  package Grep::Search::Schema;
229    
230  =head1 NAME  =head1 NAME
231    
232  Grep::Search::Schema - data definition  Grep::Search::Schema - schema definition for full-text search
233    
234  =cut  =cut
235    

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

  ViewVC Help
Powered by ViewVC 1.1.26