LucyX::Suggester - suggest terms for Apache Lucy search
use LucyX::Suggester; my $suggester = LucyX::Suggester->new( fields => [qw( foo bar )], indexes => $list_of_indexes, spellcheck => $search_tools_spellcheck, limit => 10, use_regex => 0, max_length => 64, ); my $suggestions = $suggester->suggest('quiK brwn fox');
Inspired by the Solr Suggester feature, LucyX::Suggester will return a list of suggested terms based on actual terms in the specified index(es). Spellchecking on query terms is performed with Search::Tools::SpellCheck, which uses Text::Aspell.
Returns a new Suggester object. Supported params include:
List of fields to limit Lexicon scans to.
List of indexes to search within.
An instance of Search::Tools::SpellCheck. Set this to indicate custom values for language, dictionary, and other params to Search::Tools::SpellCheck.
Maximum number of suggestions to return. Defaults to 10.
Use a simple regex when comparing terms. Defaults to false (0), preferring index(). If your analyzer results in terms containing multiple words (e.g. phrases) then use_regex is probably what you want.
Set a max term length beyond which suggestions are trimmed with substr(). Default is 64 characters. Set to 0 to disable.
Returns arrayref of terms that match query.
Peter Karman, <karman at cpan.org>
<karman at cpan.org>
Please report any bugs or feature requests to bug-lucyx-suggester at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=LucyX-Suggester. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-lucyx-suggester at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc LucyX::Suggester
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=LucyX-Suggester
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/LucyX-Suggester
CPAN Ratings
http://cpanratings.perl.org/d/LucyX-Suggester
Search CPAN
http://search.cpan.org/dist/LucyX-Suggester/
Copyright 2012 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 LucyX::Suggester, copy and paste the appropriate command in to your terminal.
cpanm
cpanm LucyX::Suggester
CPAN shell
perl -MCPAN -e shell install LucyX::Suggester
For more information on module installation, please visit the detailed CPAN module installation guide.