From 08cf0c72671e94086352b03683e1ad57348bee1f Mon Sep 17 00:00:00 2001 From: gmaurice Date: Thu, 7 Jul 2011 13:19:06 +0200 Subject: documentation added for search --- lib/Net/Riak.pm | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'lib/Net/Riak.pm') 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 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 -- cgit v1.2.3