--- lib/Grep/Search.pm 2007/05/08 13:54:20 143 +++ lib/Grep/Search.pm 2007/05/08 14:11:38 144 @@ -22,6 +22,8 @@ my $search = Grep::Search->new(); + my $serach = Grep::Search->new( create => 1 ); + =cut sub log { Jifty->web->log } @@ -34,7 +36,7 @@ $self->index_path( $index_path ); - if (! -e "$index_path") { + if ( ! -e "$index_path" || $self->create ) { $self->log->debug("Creating new index $index_path"); $self->invindexer( KinoSearch::InvIndexer->new( invindex => Grep::Search::Schema->clobber( $index_path ) ) ); } else { @@ -162,7 +164,7 @@ my $title = $hit->{title}; my $id = $hit->{id}; - $self->log->debug("result $i $score $title"); + $self->log->debug("result $i [$id] $title $score"); my $item = Grep::Model::Item->new(); my ($ok,$msg) = $item->load_by_cols( id => $id );