NAME
KinoSearch::Searcher - execute searches
SYNOPSIS
my $analyzer = KinoSearch::Analysis::PolyAnalyzer->new(
language => 'en',
);
my $searcher = KinoSearch::Searcher->new(
invindex => $invindex,
analyzer => $analyzer,
);
my $hits = $searcher->search('foo bar');
DESCRIPTION
Use the Searcher class to perform queries against an invindex.
METHODS
new
my $searcher = KinoSearch::Searcher->new(
invindex => $invindex,
analyzer => $analyzer,
);
Constructor. Takes two labeled parameters, both of which are required.
invindex - can be either a path to an invindex, or a KinoSearch::Store::InvIndex object.
analyzer - An object which subclasses KinoSearch::Analysis::Analyer, such as a PolyAnalyzer.
search
my $hits = $searcher->search("foo bar");
# or...
my $hits = $searcher->search( query => $query );
Process a search and return a Hits object.
If only a single argument is supplied to search, the Searcher will feed the text to QueryParser, and search against all of the invindex's indexed fields.
If multiple arguments are fed to search, the searcher will treat them as labeled hash-style parameters.
query - An object which subclasses KinoSearch::Search::Query.
COPYRIGHT
Copyright 2005-2006 Marvin Humphrey
LICENSE, DISCLAIMER, BUGS, etc.
See KinoSearch version 0.05_04.