summaryrefslogtreecommitdiff
path: root/lib/Net/Riak.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Net/Riak.pm')
-rw-r--r--lib/Net/Riak.pm20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/Net/Riak.pm b/lib/Net/Riak.pm
index dbfc6a5..49a4d0f 100644
--- a/lib/Net/Riak.pm
+++ b/lib/Net/Riak.pm
@@ -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
@@ -173,6 +181,18 @@ Start assembling a Map/Reduce operation
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>