diff options
Diffstat (limited to '')
| -rw-r--r-- | lib/Net/Riak.pm | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/lib/Net/Riak.pm b/lib/Net/Riak.pm index f2a9403..8ac536b 100644 --- a/lib/Net/Riak.pm +++ b/lib/Net/Riak.pm @@ -14,7 +14,7 @@ has client => ( is => 'rw', isa => Client_T, required => 1, - handles => [qw/is_alive all_buckets server_info stats/] + handles => [qw/is_alive all_buckets server_info stats search setup_indexing/] ); sub BUILDARGS { @@ -37,7 +37,7 @@ sub bucket { 1; =head1 SYNOPSIS - + # REST interface my $client = Net::Riak->new( host => 'http://10.0.0.40:8098', @@ -58,6 +58,14 @@ sub bucket { $obj = $bucket->get('new_post'); say "title for ".$obj->key." is ".$obj->data->{title}; + # Indexing and searching (REST interface) + $client->setup_indexing("bucket_name"); + ...adding documents to riak... + my $response = $client->search( + index => 'bucket_name', + q => 'field:value' + ); + =head1 DESCRIPTION =head2 ATTRIBUTES @@ -116,7 +124,7 @@ Disable returning of object content in response in a store operation. If set to true and the object has siblings these will not be available without an additional fetch. -This will become the default behaviour in 0.17 +This will become the default behaviour in 0.17 =back @@ -165,13 +173,25 @@ Start assembling a Map/Reduce operation Start assembling a Map/Reduce operation =head2 server_info (PBC only) - + $client->server_info->{server_version}; =head2 stats (REST only) say Dumper $client->stats; +=head2 search (REST only) + + $client->search( index => 'bucket_name', q => 'field:value' ); + +Makes a query to the index (see L<Net::Riak::Search> for more details on parameters) + +=head2 setup_indexing (REST only) + + $client->setup_indexing('bucket_name'); + +Define precommit hook in order to enable indexing documents written into the given bucket + =head1 SEE ALSO L<Net::Riak::MapReduce> |
