Catalyst::Model::Lucy
# 1. Setup the Model package MyCatApplication::Model::Lucy; use base qw(Catalyst::Model::Lucy); my $other_type = Lucy::Plan::FullTextType->new( analyzer => Lucy::Analysis::PolyAnalyzer->new( language => 'en' ) ); __PACKAGE__->config( index_path => File::Spec->catfile($FindBin::Bin,'index/path/'), num_wanted => 20, language => 'en', create_index => 1, # Optional truncate_index => 1, # Optional schema_params => [ # Optional schema params { name => 'title' }, # defaults to Lucy::Plan::FullTextType { name => 'desc', type => $other_type } ] ); # 2. Use in a controller my $results = $c->model('Lucy')->hits( query => 'foo' ); while ( my $hit = $results->next ) { print $hit->{title},"\n"; }
This is a catalyst model for Apache Lucy.
Sets the create_index flag to either 1 or 0 when initializing Lucy::Index::Indexer. Default value is 0.
Specifies the path to the index. The default path is $FindBin::Bin/index.
This is Lucy::Search::IndexSearcher
This is Lucy::Index::Indexer
This is the index language, the default value is en.
This is the number of hits the index_searcher will return. This is for pagination.
Accessor to Lucy::Plan::Schema
Used when the indexer is initialized. The values of this are used to define any custom scheme for index creation. See <Lucy::Plan::Schema>
Sets the truncate flag to either 1 or 0 when initializing Lucy::Index::Indexer. Default value is 0.
Logan Bell email:logie@cpan.org
Lucy, Catalyst::Model
Copyright 2012, Logan Bell email:logie@cpan.org
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Catalyst::Model::Lucy, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Catalyst::Model::Lucy
CPAN shell
perl -MCPAN -e shell install Catalyst::Model::Lucy
For more information on module installation, please visit the detailed CPAN module installation guide.