Author image 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('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("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.

COPYRIGHT

Copyright 2005-2006 Marvin Humphrey

LICENSE, DISCLAIMER, BUGS, etc.

See KinoSearch version 0.05.