NAME
KSx::Search::RegexpTermQuery - Regular expression term query class for KinoSearch
VERSION
0.05
SYNOPSIS
use KSx::Search::RegexpTermQuery
my $query = new KSx::Search::RegexpTermQuery
regexp => qr/^foo/,
field => 'content',
;
$searcher->hits($query);
# etc.
DESCRIPTION
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
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
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
The development version of KinoSearch available at http://www.rectangular.com/svn/kinosearch/trunk, revision 4810 or higher.
AUTHOR & COPYRIGHT
Copyright (C) 2008-9 Father Chrysostomos <sprout at, um, cpan.org>
This program is free software; you may redistribute or modify it (or both) under the same terms as perl.
ACKNOWLEDGEMENTS
Much of the code in this module was plagiarized from Marvin Humphrey's KinoSearch modules.
SEE ALSO
KinoSearch, KinoSearch::Search::Query, KSx::Search::WildCardQuery