/[Grep]/bin/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

Diff of /bin/kinosearch.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 181 by dpavlin, Wed Apr 9 16:53:09 2008 UTC revision 190 by dpavlin, Fri May 23 21:05:42 2008 UTC
# Line 6  Line 6 
6    
7  use strict;  use strict;
8  use blib './lib';  use blib './lib';
9  use Grep::Search;  use Grep::Search::KinoSearch;
10  use KinoSearch::Highlight::Highlighter;  use KinoSearch::Highlight::Highlighter;
11  use Data::Dump qw/dump/;  use Data::Dump qw/dump/;
12    
# Line 15  my ( $index_path, $query_string ) = @ARG Line 15  my ( $index_path, $query_string ) = @ARG
15  die "usage: $0 /path/to/index 'search query'\n" unless ( $index_path && $query_string );  die "usage: $0 /path/to/index 'search query'\n" unless ( $index_path && $query_string );
16    
17  my $searcher = KinoSearch::Searcher->new(  my $searcher = KinoSearch::Searcher->new(
18                  invindex => Grep::Search::Schema->open( $index_path )                  invindex => Grep::Search::KinoSearch::Schema->open( $index_path )
19  );  );
20    
21  my @fields = ( qw/ title link content summary category author / );  my @fields = ( qw/ title link content summary category author / );
22  my @excerpt_fields = ( qw/ content summary / );  my @excerpt_fields = ( qw/ content summary / );
23    
24  my $query_parser = KinoSearch::QueryParser->new(  my $query_parser = KinoSearch::QueryParser->new(
25          schema => Grep::Search::Schema->new,          schema => Grep::Search::KinoSearch::Schema->new,
26          fields => \@fields,          fields => \@fields,
27  );  );
28  $query_parser->set_heed_colons(1);       # enable field:value AND/OR/NOT syntax  $query_parser->set_heed_colons(1);       # enable field:value AND/OR/NOT syntax

Legend:
Removed from v.181  
changed lines
  Added in v.190

  ViewVC Help
Powered by ViewVC 1.1.26