11 Mar 2006 05:47:55 UTC
- Distribution: KinoSearch
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (5)
- Testers (4 / 3 / 0)
- KwaliteeBus factor: 0
- License: perl_5
- Activity24 month
- Download (169.28KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest versionCREAMYG Marvin Humphreyand 1 contributors
- Marvin Humphrey <marvin at rectangular dot com>
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.08.