Spaces in the search string

sean mcevoy sean.mcevoy at gmail.com
Mon Sep 5 18:24:18 EDT 2016


Hi List,

We have a solr index where we store something like:
<<"{\"key_s\":\"ID\",\"body_s\":\"some test string\"}">>}],

Then we try to do a riakc_pb_socket:search with the pattern:
<<"body_s:*test str*">>

The request will fail with an error message telling us to check the logs
and in there we find:

2016-09-05 13:37:29.271 [error] <0.12067.10>@yz_pb_search:maybe_process:107
{solr_error,{400,"
http://localhost:10014/internal_solr/crm_db.campaign_index/select",<<"{\"error\":{\"msg\":\"no
field name specified in query and no default specified via 'df'
param\",\"code\":400}}\n">>}}
[{yz_solr,search,3,[{file,"src/yz_solr.erl"},{line,284}]},{yz_pb_search,maybe_process,3,[{file,"src/yz_pb_search.erl"},{line,78}]},{riak_api_pb_server,process_message,4,[{file,"src/riak_api_pb_server.erl"},{line,388}]},{riak_api_pb_server,connected,2,[{file,"src/riak_api_pb_server.erl"},{line,226}]},{riak_api_pb_server,decode_buffer,2,[{file,"src/riak_api_pb_server.erl"},{line,364}]},{gen_fsm,handle_msg,7,[{file,"gen_fsm.erl"},{line,505}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]


Through experiment I've figured out that it doesn't like the space as it
seems to think the part of the search string after that space is a new key
to search for. Which seems fair enough.

Anyone know of a work-around? Or am I formatting my request incorrectly?

Thanks in advance.
//Sean.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20160905/97c79e22/attachment-0002.html>


More information about the riak-users mailing list