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( query => '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. This must be identical to the Analyzer used at index-time, or the results won't match up.
search
my $hits = $searcher->search( query => $query );
Process a search and return a Hits object.
search() expects labeled hash-style parameters. At present, there is only one: query. It is likely that others will be added later.
query - Can be either an object which subclasses KinoSearch::Search::Query, or a query string. If it's a query string, it will be parsed using a QueryParser and a search will be performed against all indexed fields in the invindex. For more sophisticated searching, supply Query objects, such as TermQuery and BooleanQuery.
COPYRIGHT
Copyright 2005-2006 Marvin Humphrey
LICENSE, DISCLAIMER, BUGS, etc.
See KinoSearch version 0.07.