SWISH::Prog::Lucy::Searcher - search Swish3 Lucy backend
my $searcher = SWISH::Prog::Lucy::Searcher->new( invindex => 'path/to/index', max_hits => 1000, find_relevant_fields => 1, # default: 0 ); my $results = $searcher->search( 'foo bar' ); while (my $result = $results->next) { printf("%4d %s\n", $result->score, $result->uri); }
SWISH::Prog::Lucy::Searcher is an Apache Lucy based Searcher class for Swish3.
SWISH::Prog::Lucy::Searcher is not made to replace the more fully-featured Lucy::Search::Searcher class and its friends. Instead, SWISH::Prog::Lucy::Searcher provides a simple API similar to other SWISH::Prog::Searcher-based backends so that you can experiment with alternate storage engines without needing to change much code. When your search application requirements become more complex, the author recommends the switch to using Lucy::Search::Searcher directly.
Only new and overridden methods are documented here. See the SWISH::Prog::Searcher documentation.
Called internally by new(). Additional parameters include:
Set to true to have the Results object locate the fields that matched the query. Default is 0 (off).
Returns a SWISH::Prog::Lucy::Results object.
query is assumed to be query string compatible with Search::Query::Dialect::Lucy.
opts is an optional hashref with the following supported key/values:
The starting position. Default is 0.
The ending position. Default is max_hits() as documented in SWISH::Prog::Searcher.
Takes a SQL-like text string (like SWISH::Prog::Native::Searcher) or a Lucy::Search::SortSpec object, which will determine the sort order.
Takes an arrayref of arrayrefs. Each child arrayref should have three values: a field (PropertyName) value, a lower limit and an upper limit.
The default boolean connector for parsing query. Valid values are AND and OR. The default is AND (which is different than Lucy::QueryParser, but the same as Swish-e).
Returns the internal Lucy::Search::PolySearcher object.
Peter Karman, <karman at cpan.org>
<karman at cpan.org>
Please report any bugs or feature requests to bug-swish-prog-lucy at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=SWISH-Prog-Lucy. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-swish-prog-lucy at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc SWISH::Prog::Lucy
You can also look for information at:
Mailing list
http://lists.swish-e.org/listinfo/users
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=SWISH-Prog-Lucy
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/SWISH-Prog-Lucy
CPAN Ratings
http://cpanratings.perl.org/d/SWISH-Prog-Lucy
Search CPAN
http://search.cpan.org/dist/SWISH-Prog-Lucy/
Copyright 2009 Peter Karman.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install SWISH::Prog::Lucy, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SWISH::Prog::Lucy
CPAN shell
perl -MCPAN -e shell install SWISH::Prog::Lucy
For more information on module installation, please visit the detailed CPAN module installation guide.