summary refs log tree commit diff
path: root/lib/Net/Riak.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Net/Riak.pm')
-rw-r--r--lib/Net/Riak.pm26
1 files changed, 23 insertions, 3 deletions
diff --git a/lib/Net/Riak.pm b/lib/Net/Riak.pm
index dbfc6a5..45d445a 100644
--- a/lib/Net/Riak.pm
+++ b/lib/Net/Riak.pm
@@ -37,7 +37,7 @@ sub bucket {
 1;
 
 =head1 SYNOPSIS
-    
+
     # REST interface
     my $client = Net::Riak->new(
         host => 'http://10.0.0.40:8098',
@@ -59,6 +59,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
@@ -117,7 +125,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
 
@@ -166,13 +174,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>