Error when trying to use a javascript custom extractor in Riaksearch

Greg Pascale greg at
Sat May 21 22:48:13 EDT 2011

I've been banging my head against the wall trying to get a javascript custom
extractor working. Here is the simplest example I could come up with to
reproduce the error.

*curl -v -X PUT -H "Content-Type: application/json"
http://localhost:8098/riak/test -d @data*

where *@data* is a file that looks like

* {"rs_extractfun":*
*  {"language" : "javascript", *
*   "source" : "function(a,b){return{\"user\":\"gpascale\",
*  }*
* }*
This completes successfully, and I can verify it by looking at the
properties of the "test" bucket.


However, when I try to insert something into the bucket, I get an error

*curl -X PUT http://localhost:8098/riak/test/test1 -d "Hello, world!"*

*        [{erlang,iolist_to_binary,*
*             [{hook_crashed,*
*                  {riak_search_kv_hook,precommit,exit,*
*                      {noproc,*
*                          {gen_server,call,*
*                              [riak_search_js_extract,reserve_vm,*
*                               infinity]}}}}]},*
*         {wrq,append_to_response_body,2},*
*         {riak_kv_wm_raw,accept_doc_body,2},*
*         {webmachine_resource,resource_call,3},*
*         {webmachine_resource,do,3},*
*         {webmachine_decision_core,resource_call,1},*
*         {webmachine_decision_core,accept_helper,0},*
*         {webmachine_decision_core,decision,1}]}}*
It doesn't matter if the thing I insert is a string, as above, or real json
object that matches my schema - the error is the same. Any ideas what might
be going on here?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the riak-users mailing list