Marvin Humphrey
and 1 contributors

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.

    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.06.