projects
/
angular-mojolicious.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
use floating point 10.5 unix timestamp as key
[angular-mojolicious.git]
/
couchdb-external-kinosearch.pl
diff --git
a/couchdb-external-kinosearch.pl
b/couchdb-external-kinosearch.pl
index
d52f8f5
..
b455bfd
100755
(executable)
--- a/
couchdb-external-kinosearch.pl
+++ b/
couchdb-external-kinosearch.pl
@@
-12,10
+12,6
@@
use Data::Dump qw(dump);
$|=1;
$|=1;
-my $searcher = KinoSearch::Search::IndexSearcher->new(
- index => '/tmp/index'
-);
-
our $json = Mojo::JSON->new;
open(my $log, '>>', '/tmp/couchdb-external-kinosearch.log');
our $json = Mojo::JSON->new;
open(my $log, '>>', '/tmp/couchdb-external-kinosearch.log');
@@
-32,6
+28,10
@@
while(<STDIN>) {
if ( my $q = $request->{query}->{q} ) {
if ( my $q = $request->{query}->{q} ) {
+ my $searcher = KinoSearch::Search::IndexSearcher->new(
+ index => '/tmp/kinosearch.' . $request->{info}->{db_name},
+ );
+
my $hits = $searcher->hits( query => $q );
$response->{json}->{total_hits} = $hits->total_hits;
my $hits = $searcher->hits( query => $q );
$response->{json}->{total_hits} = $hits->total_hits;