Parent Directory | Revision Log
r1529@llin: dpavlin | 2007-11-04 15:44:22 +0100 Simpliest possible searcher helper for KinoSearch to see index content
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 |
Name | Value |
---|---|
svn:executable | * |
ViewVC Help | |
Powered by ViewVC 1.1.26 |