AnyEvent::Groonga - Groonga client for AnyEvent
use AnyEvent::Groonga; my $groonga = AnyEvent::Groonga->new( protocol => 'http', host => 'localhost, port => '10041', ); # blocking interface my $result = $groonga->call(select => { table => "Site", query => 'title:@test', output_columns => [qw(_id _score title)], sortby => '_score', })->recv; # result is AnyEvent::Groonga::Result::Select object print $result->dump; # non-blocking interface $groonga->call(select => { table => "Site", query => 'title:@test', output_columns => [qw(_id _score title)], sortby => '_score', })->cb( sub { my $result = $_[0]->recv; } ); print Dumper $result->items;
This is groonga client module for AnyEvent applications.
groonga is an open-source fulltext search engine and column store.
http://groonga.org/
Create groonga client object.
my $groonga = AnyEvent::Groonga->new( protocol => 'http', host => 'localhost, port => '10041', );
Available options are:
groonga-server speaks http and gqtp protocol (groonga original protocol).
And it works for local database file, too.
It is necessary if you set the protocol as gqtp or local_db.
It is necessary if you set the protocol as local_db.
Call groonga command named $command with %args parameters.
It returns AnyEvent condvar object for response.
# blocking interface my $result = $groonga->call(select => { table => "Site", query => 'title:@test', output_columns => [qw(_id _score title)], sortby => '_score', })->recv; # result is AnyEvent::Groonga::Result::Select object print $result->dump; # non-blocking interface $groonga->call(select => { table => "Site", query => 'title:@test', output_columns => [qw(_id _score title)], sortby => '_score', })->cb( sub { my $result = $_[0]->recv; } );
Available commands are:
See Groonga's official site. http://groonga.org/
Takeshi Miki <miki@cpan.org>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install AnyEvent::Groonga, copy and paste the appropriate command in to your terminal.
cpanm
cpanm AnyEvent::Groonga
CPAN shell
perl -MCPAN -e shell install AnyEvent::Groonga
For more information on module installation, please visit the detailed CPAN module installation guide.