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 } |
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 { |
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 ); |