Search and Erlang client

Doug Selph dselph at gmail.com
Mon Mar 5 06:30:47 EST 2012


Hi Dan,

It took me several days to get back to this issue; my apologies. I was able
to track down what was happening. Bottom line is this: I was creating a new
Riak object with the desired content type. I was then updating the metadata
on the new object before saving it in order to add 2i information. The
updated metadata did not include the content type, so I was clobbering it
before saving. The resulting content type was 'application/octet-stream'

Thanks for your replies.
Doug


On Mon, Feb 27, 2012 at 5:52 PM, Dan Reverri <dan at basho.com> wrote:

> Hi Doug,
>
> The Erlang client will use whatever content-type is set by the user. Can
> you provide an example of how you are creating your objects?
>
> The following worked for me:
> {ok, Pid} = riakc_pb_socket:start_link("127.0.0.1", 8087).
> O = riakc_obj:new(<<"bucket">>, <<"key">>, <<"{\"foo\":\"bar\"}">>,
> <<"application/json">>).
> riakc_pb_socket:put(Pid, O).
>
> Thanks,
> Dan
>
> Daniel Reverri
> Developer Advocate
> Basho Technologies, Inc.
> dan at basho.com
>
>
> On Mon, Feb 27, 2012 at 11:17 AM, Doug Selph <dselph at gmail.com> wrote:
>
>> Hi Dan,
>>
>> Well, I'm stumped. When creating the object, I pass "application/json" as
>> content-type, but all my objects have content-type set to
>> "application/octet-stream"
>>
>> Does the erlang client save everything as a binary?
>>
>> Thanks,
>> Doug
>>
>>
>> On Mon, Feb 27, 2012 at 12:10 PM, Dan Reverri <dan at basho.com> wrote:
>>
>>> Hi Doug,
>>>
>>> Can you confirm the "Content-Type" header is set to "application/json"
>>> by reading the JSON objects you stored?
>>>
>>> Can you share an example JSON object as well as an example query you are
>>> running with "search-cmd"?
>>>
>>> Thank you,
>>> Dan
>>>
>>> Daniel Reverri
>>> Developer Advocate
>>> Basho Technologies, Inc.
>>> dan at basho.com
>>>
>>>
>>> On Sun, Feb 26, 2012 at 9:01 PM, Doug Selph <dselph at gmail.com> wrote:
>>>
>>>>  I'm having trouble with riak-search. If I use the seach-cmd command
>>>> line tool to index text files, I can search the index using both search-cmd
>>>> and the sold interface. However, when I store JSON objects via the erlang
>>>> protocol buffers client, in a bucket which has the search pre-commit
>>>> trigger installed, searches in that index always return 0 matches for
>>>> search terms which have matches in the bucket. (I have saved these objects
>>>> to the bucket after the pre-commit trigger was installed.)
>>>>
>>>> Is there a trick to this? It is my understanding that there is a
>>>> default schema for JSON objects, which should be sufficient as a starting
>>>> point.
>>>>
>>>> _______________________________________________
>>>> riak-users mailing list
>>>> riak-users at lists.basho.com
>>>> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>>>>
>>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20120305/e5ffbf5e/attachment.html>


More information about the riak-users mailing list