- AUTHOR & COPYRIGHT
- SEE ALSO
KSx::Search::RegexpTermQuery - Regular expression term query class for KinoSearch
use KSx::Search::RegexpTermQuery my $query = new KSx::Search::RegexpTermQuery regexp => qr/^foo/, field => 'content', ; $searcher->hits($query); # etc.
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.
If a regular expression has a fixed literal prefix anchored to the beginning of the string (e.g., the
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.
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.
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.
Much of the code in this module was plagiarized from Marvin Humphrey's KinoSearch modules.