Net::Riak::Search - Search interface
version 0.1700
my $client = Net::Riak->new(...); my $bucket = $client->bucket('foo'); # retrieve an existing object my $obj1 = $bucket->get('foo'); # create/store a new object my $obj2 = $bucket->new_object('foo2', {...}); $object->store; $bucket->delete_object($key, 3); # optional w val
Net::Riak::Search allows you to enable indexing documents for a given bucket and querying/searching the index.
$client->setup_indexing('bucket_name');
Does the same as :
curl -X PUT -H "content-type:application/json" http://localhost:8098/riak/bucket_name -d '{"props":{"precommit":[{"mod":"riak_search_kv_hook","fun":"precommit"}]}'
but takes in account previouses precommits.
my $response = $client->search( index => 'bucket_name', q => 'field:value' ); # is the same as : my $response = $client->search( q => 'bucket_name.field:value' );
Search the index
defines the response format (XML is the default value as for Solr/Lucene)
the query string
is the default index you want to query, if no index is provided you have to add it as a prefix of the fields in the query string
is the number of documents you want to be returned in the response
More parameters are available, just check at http://wiki.basho.com/Riak-Search---Querying.html#Querying-via-the-Solr-Interface
franck cuny <franck@lumberjaph.net>, robin edwards <robin.ge@gmail.com>
This software is copyright (c) 2011 by linkfluence.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Net::Riak, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::Riak
CPAN shell
perl -MCPAN -e shell install Net::Riak
For more information on module installation, please visit the detailed CPAN module installation guide.