Riak Search up and running

44 views
Skip to first unread message

Simone Mosciatti

unread,
Jun 14, 2013, 11:04:34 AM6/14/13
to clojur...@googlegroups.com
Hi all,

I am new of this group but I already have a problem.

I need a Riak system with Search and it is a lot of days that I try to proper set the system, however it is not working out how I am expecting.

What I did for now is to modify the app.config file under riak to allow search:
 {riak_search, [
                %% To enable Search functionality set this 'true'.
                {enabled, true}
               ]},

Then I create a bucket.
I checked it with wb/update and I saw that search was not set to true (why that ???)
So i fixed still with wb/update
In the command line I ran
search-cmd install "bucket's-name"
Then I put some document inside the bucket:
(riak/put "try" "me" {"name" "simone" "surname" "mosciatti"})
And the document is actually there:
(riak/get "try" "me")
({:metadata {}, :deleted? false, :content-type "application/json", :vtag "\"5Md6OsZdYP6nBAyB6rAGLj\"", :vclock #<BasicVClock com.basho.riak.client.cap.BasicVClock@7e31c78a>, :indexes {}, :links (), :last-modified #inst "2013-06-14T14:53:22.000-00:00", :value {:name "simone", :surname "mosciatti"}})

So I tried to query riak with search, from the command line and from welle:
[simo@localhost bin]$ search-cmd search "simone"
Attempting to restart script through sudo -H -u riak
[sudo] password for simo: 

 :: Searching for 'simone' / '' in search...

------------------------------

 :: Found 0 results.
[simo@localhost bin]$ search-cmd search-doc "simone"
Attempting to restart script through sudo -H -u riak

 :: Searching for 'simone' / '' in search...

------------------------------

 :: Found 0 results.
 :: Maximum score "0.0".
[simo@localhost bin]$ search-cmd search-doc name "simone"
Attempting to restart script through sudo -H -u riak

 :: Searching for 'simone' / '' in name...

------------------------------

 :: Found 0 results.
 :: Maximum score "0.0".
[simo@localhost bin]$ search-cmd search name "simone"
Attempting to restart script through sudo -H -u riak

 :: Searching for 'simone' / '' in name...

------------------------------

 :: Found 0 results.

(wsolr/search "name" "simone")
{:responseHeader {:status 0, :QTime 0, :params {:q "simone", :q.op "or", :filter "", :wt "json"}}, :response {:numFound 0, :start 0, :maxScore "0.0", :docs []}}
 

But I don't get nothing back...

I also tried the wsolr/index function, but I get error:

(wsolr/index (riak/bucket "try") {:name "leonardo" :surname "rossetti"})
ExceptionInfo clj-http: status 400  clj-http.client/wrap-exceptions/fn--4347 (client.clj:124)


Am I missing something ?

Thank you all...

Michael Klishin

unread,
Jun 14, 2013, 11:33:54 AM6/14/13
to clojur...@googlegroups.com

2013/6/14 Simone Mosciatti <mweb...@gmail.com>

(wsolr/index (riak/bucket "try") {:name "leonardo" :surname "rossetti"})

What's this riak namespace? clojurewerkz.welle.solr/index takes a bucket name as a string.
It would also be a good idea to print-cause-trace on exceptions you encounter as list members
cannot do that for you.

Search needs to be enabled per-bucket (in theory search-cmd install should do it but I haven't used it):

Simone Mosciatti

unread,
Jun 14, 2013, 3:10:26 PM6/14/13
to clojur...@googlegroups.com
Ok thank you, the test was very very useful.

IDK why I haven't thought about it earlier...
Reply all
Reply to author
Forward
0 new messages