/[webpac2]/trunk/scripts/kinosearch.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /trunk/scripts/kinosearch.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 995 - (show annotations)
Sun Nov 4 14:44:26 2007 UTC (16 years, 5 months ago) by dpavlin
File MIME type: text/plain
File size: 594 byte(s)
 r1529@llin:  dpavlin | 2007-11-04 15:44:22 +0100
 Simpliest possible searcher helper for KinoSearch to see index content

1 #!/usr/bin/perl -w
2
3 # kinosearch.pl
4 #
5 # 11/04/07 15:41:02 CET Dobrica Pavlinusic <dpavlin@rot13.org>
6
7 use strict;
8
9 use KinoSearch::Simple;
10 use Data::Dump qw/dump/;
11
12 my ( $path, $query_string ) = @ARGV;
13
14 die "usage: $0 var/kinosearch/index 'query string'\n" unless $path && $query_string && -e $path;
15
16 my $index = KinoSearch::Simple->new(
17 path => $path,
18 language => 'en',
19 );
20
21 my $total_hits = $index->search(
22 query => $query_string,
23 offset => 0,
24 num_wanted => 100,
25 );
26
27 print "Total hits: $total_hits\n";
28
29 while ( my $hit = $index->fetch_hit_hashref ) {
30 print dump( $hit );
31 }
32

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26