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 From f3c37bba30c316f6b37d82282f6ecf0cef61ea62 Mon Sep 17 00:00:00 2001 From: franck cuny Date: Thu, 7 Jul 2011 13:22:27 +0200 Subject: remove white spaces Signed-off-by: franck cuny --- lib/Net/Riak.pm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lib/Net/Riak.pm') diff --git a/lib/Net/Riak.pm b/lib/Net/Riak.pm index 49a4d0f..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', @@ -58,7 +58,7 @@ 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... @@ -125,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 @@ -174,7 +174,7 @@ 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) @@ -190,8 +190,8 @@ Makes a query to the index (see L for more details on paramet =head2 setup_indexing (REST only) $client->setup_indexing('bucket_name'); - -Define precommit hook in order to enable indexing documents written into the given bucket + +Define precommit hook in order to enable indexing documents written into the given bucket =head1 SEE ALSO -- cgit v1.2.3