KinoSearch::Searcher - execute searches
my $analyzer = KinoSearch::Analysis::PolyAnalyzer->new( language => 'en', ); my $searcher = KinoSearch::Searcher->new( invindex => $invindex, analyzer => $analyzer, ); my $hits = $searcher->search( query => 'foo bar' );
Use the Searcher class to perform queries against an invindex.
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.
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 2005-2006 Marvin Humphrey
See KinoSearch version 0.06.