/[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 143 by dpavlin, Tue May 8 12:37:28 2007 UTC revision 144 by dpavlin, Tue May 8 14:11:38 2007 UTC
# Line 22  Grep::Search - full text search using L< Line 22  Grep::Search - full text search using L<
22    
23    my $search = Grep::Search->new();    my $search = Grep::Search->new();
24    
25      my $serach = Grep::Search->new( create => 1 );
26    
27  =cut  =cut
28    
29  sub log { Jifty->web->log }  sub log { Jifty->web->log }
# Line 34  sub new { Line 36  sub new {
36    
37          $self->index_path( $index_path );          $self->index_path( $index_path );
38    
39          if (! -e "$index_path") {          if ( ! -e "$index_path" || $self->create ) {
40                  $self->log->debug("Creating new index $index_path");                  $self->log->debug("Creating new index $index_path");
41                  $self->invindexer( KinoSearch::InvIndexer->new( invindex => Grep::Search::Schema->clobber( $index_path ) ) );                  $self->invindexer( KinoSearch::InvIndexer->new( invindex => Grep::Search::Schema->clobber( $index_path ) ) );
42          } else {          } else {
# Line 162  sub collection { Line 164  sub collection {
164                  my $title = $hit->{title};                  my $title = $hit->{title};
165                  my $id = $hit->{id};                  my $id = $hit->{id};
166    
167                  $self->log->debug("result $i $score $title");                  $self->log->debug("result $i [$id] $title $score");
168    
169                  my $item = Grep::Model::Item->new();                  my $item = Grep::Model::Item->new();
170                  my ($ok,$msg) = $item->load_by_cols( id => $id );                  my ($ok,$msg) = $item->load_by_cols( id => $id );

Legend:
Removed from v.143  
changed lines
  Added in v.144

  ViewVC Help
Powered by ViewVC 1.1.26