Peter Karman > LucyX-Suggester-0.005 > LucyX::Suggester

Download:
LucyX-Suggester-0.005.tar.gz

Dependencies

Annotate this POD

Website

CPAN RT

Open  0
View/Report Bugs
Module Version: 0.005   Source  

NAME ^

LucyX::Suggester - suggest terms for Apache Lucy search

SYNOPSIS ^

 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');

DESCRIPTION ^

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.

METHODS ^

new( params )

Returns a new Suggester object. Supported params include:

fields arrayref

List of fields to limit Lexicon scans to.

indexes arrayref

List of indexes to search within.

spellcheck search_tools_spellcheck

An instance of Search::Tools::SpellCheck. Set this to indicate custom values for language, dictionary, and other params to Search::Tools::SpellCheck.

limit n

Maximum number of suggestions to return. Defaults to 10.

use_regex 1|0

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.

max_length n

Set a max term length beyond which suggestions are trimmed with substr(). Default is 64 characters. Set to 0 to disable.

suggest( query )

Returns arrayref of terms that match query.

AUTHOR ^

Peter Karman, <karman at cpan.org>

BUGS ^

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.

SUPPORT ^

You can find documentation for this module with the perldoc command.

    perldoc LucyX::Suggester

You can also look for information at:

COPYRIGHT & LICENSE ^

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.

syntax highlighting: