$|=1;
-my $searcher = KinoSearch::Search::IndexSearcher->new(
- index => '/tmp/index'
-);
-
our $json = Mojo::JSON->new;
open(my $log, '>>', '/tmp/couchdb-external-kinosearch.log');
if ( my $q = $request->{query}->{q} ) {
+ my $searcher = KinoSearch::Search::IndexSearcher->new(
+ index => '/tmp/index'
+ );
+
my $hits = $searcher->hits( query => $q );
$response->{json}->{total_hits} = $hits->total_hits;