KSx::Search::RegexpTermQuery - Regular expression term query class for KinoSearch


KSx-Search-WildCardQuery documentation  | view source Contained in the KSx-Search-WildCardQuery distribution.

Index


NAME

Top

KSx::Search::RegexpTermQuery - Regular expression term query class for KinoSearch

VERSION

Top

0.05

SYNOPSIS

Top

    use KSx::Search::RegexpTermQuery
    my $query = new KSx::Search::RegexpTermQuery
        regexp => qr/^foo/,
        field  => 'content',
    ;

    $searcher->hits($query);
    # etc.

DESCRIPTION

Top

This module provides search query objects for KinoSearch that find terms that match a particular regular expression. Note that a query will only match a single term; it is not a regexp match against an entire field.

PERFORMANCE

Top

If a regular expression has a fixed literal prefix anchored to the beginning of the string (e.g., the foo in qr/^foo[dl]$/), only the 'foo' words in the index will be scanned, so this should not be too slow, as long as the prefix is fairly long, or there are sufficiently few 'foo' words. If, however, there is no literal prefix (e.g., qr/foo/), the entire index will be scanned, so beware.

METHODS

Top

new

This is the constructor. It constructs. Call it with hash-style arguments as shown in the SYNOPSIS. The regexp can be a qr// thingy or a string.

PREREQUISITES

Top

Hash::Util::FieldHash::Compat

The development version of KinoSearch available at http://www.rectangular.com/svn/kinosearch/trunk, revision 4810 or higher.

AUTHOR & COPYRIGHT

Top

ACKNOWLEDGEMENTS

Top

Much of the code in this module was plagiarized from Marvin Humphrey's KinoSearch modules.

SEE ALSO

Top

KinoSearch, KinoSearch::Search::Query, KSx::Search::WildCardQuery


KSx-Search-WildCardQuery documentation  | view source Contained in the KSx-Search-WildCardQuery distribution.