/[webpac2]/branches/Sack/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

Annotation of /branches/Sack/scripts/kinosearch.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1310 - (hide annotations)
Mon Sep 21 19:04:14 2009 UTC (14 years, 8 months ago) by dpavlin
File MIME type: text/plain
File size: 594 byte(s)
branch for refactoring of WebPAC::Input::* modules for Sack

1 dpavlin 995 #!/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