Re: Object metadata via NodeJS client

2015-04-07 Thread José Ghislain Quenum
Luke,
In my current implementation, I use metadata for both links and secondary
index.

On Mon, Apr 6, 2015 at 4:03 PM, Luke Bakken  wrote:

> Hi José,
>
> Other than links, what object metadata are you trying to access or modify?
>
> Thanks -
>
> --
> Luke Bakken
> Engineer
> lbak...@basho.com
>
>
> On Sat, Apr 4, 2015 at 6:56 AM, José Ghislain Quenum
>  wrote:
> > Thanks Brian for your reply and trying to work out the links part.  I
> > took a look at the RiakObject and could see how to manipulate it with
> > FetchValue and the Secondary Index. However, I failed to figure out
> > how to access the meta while reading an object. Just as an example,
> > when you're updating an object you could be using some meta data, and
> > some of them come from a prior read.
> >
> > If you could just share some examples with code  that'd be very helpful.
> >
> > Thanks José
>
___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


Deserialising nested Json into java object through Java -clinet

2015-04-07 Thread Santi Kumar
Hi
We have a Composite pojo which we are indexing into Riak search. If I see
the structure of the object in solr web console, it shows as nested json.
Through java client when we query it returns the Map and having
difficulties in converting it into java object. Is there a way in riak-java
client to return a pojo instead of Map and we dealing with jakson mappers?

Thanks
Santi
___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


Re: Deserialising nested Json into java object through Java -clinet

2015-04-07 Thread Brian Roach
Santi,

There is nothing in the Riak Java client to do that, no.

The result of a search query over the Riak protocol buffers API
returns the fields you queried for as a series of key/value pairs,
with the value always being a string. This is unfortunate when it
comes to mapping those values back to a class (or just serializing
them to JSON) if there was any non-string values (numbers or null).

The Java client presents a returned document as a Map> for this reason, the list being required as there could
be multiple values for a single key.

That said, it shouldn't be too difficult to write a custom
deserializer for Jackson if you know what the results are going to
look like in advance. If you could show a dump of the Map being
returned by the Riak client we may be able to help with that. Another
option would be to use a Solr client and query Solr directly rather
than going through Riak.

Thanks,
Brian Roach




On Tue, Apr 7, 2015 at 8:32 AM, Santi Kumar  wrote:
> Hi
> We have a Composite pojo which we are indexing into Riak search. If I see
> the structure of the object in solr web console, it shows as nested json.
> Through java client when we query it returns the Map and having difficulties
> in converting it into java object. Is there a way in riak-java client to
> return a pojo instead of Map and we dealing with jakson mappers?
>
> Thanks
> Santi
>
> ___
> riak-users mailing list
> riak-users@lists.basho.com
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>

___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


Re: Object metadata via NodeJS client

2015-04-07 Thread Luke Bakken
Hi José,

Please refer to this document:

http://basho.github.io/riak-nodejs-client/classes/RiakObject.html

When you retrieve a value, you get a RiakObject back:

client.fetchValue({ bucket: 'test', key: 'foo' }, function (err, rslt) {
var riakObj = rslt.values.shift();
});

This RiakObject exposes several methods related to metadata.

I just released version 1.1.0 which adds support for links. You'll see
that in the API docs now.

--
Luke Bakken
Engineer
lbak...@basho.com


On Tue, Apr 7, 2015 at 5:27 AM, José Ghislain Quenum
 wrote:
> Luke,
> In my current implementation, I use metadata for both links and secondary
> index.
>
> On Mon, Apr 6, 2015 at 4:03 PM, Luke Bakken  wrote:
>>
>> Hi José,
>>
>> Other than links, what object metadata are you trying to access or modify?
>>
>> Thanks -
>>
>> --
>> Luke Bakken
>> Engineer
>> lbak...@basho.com
>>
>>
>> On Sat, Apr 4, 2015 at 6:56 AM, José Ghislain Quenum
>>  wrote:
>> > Thanks Brian for your reply and trying to work out the links part.  I
>> > took a look at the RiakObject and could see how to manipulate it with
>> > FetchValue and the Secondary Index. However, I failed to figure out
>> > how to access the meta while reading an object. Just as an example,
>> > when you're updating an object you could be using some meta data, and
>> > some of them come from a prior read.
>> >
>> > If you could just share some examples with code  that'd be very helpful.
>> >
>> > Thanks José
>
>

___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


Re: Riak Search 2.0 & Tagging

2015-04-07 Thread Zeeshan Lakhani
Hello Antonio,

Firstly, please always reply to the list and not via personal email.

In regards to your question, I wrote a test that showcases how to write objects 
with tags in pb for search: 
https://github.com/basho/yokozuna/pull/479/files#diff-f9f0e102b2a5208f41b2f304ada0ee5cR306
 
.
 It’s a bit of a workaround, needing the ‘x-riak-meta*’, which gets stripped in 
preparation for query, but it does work.

Please make sure you’ve also created an index and associated it with a 
bucket_type/bucket, i.e. 
http://docs.basho.com/riak/latest/dev/using/search/#Simple-Setup 
. To query, 
it’d be the same as in the docs (field:*query*): 
http://docs.basho.com/riak/latest/dev/using/search/#Querying 
.

Thanks.

Zeeshan Lakhani
programmer | 
software engineer at @basho | 
org. member/founder of @papers_we_love | paperswelove.org
twitter => @zeeshanlakhani

> On Apr 7, 2015, at 4:28 AM, Antonio Teixeira  wrote:
> 
> Hi ,
> 
> I've been experimenting with with Riak Search and Tags but I've reached a 
> dead-end. I can't find any documentation on Querying Tags, I have followed 
> your example at: 
> https://github.com/basho/riak-erlang-client/blob/7487c90275c88dbe8ef4c2fed6540864364ca3d4/src/riakc_...
>  
> 
> Here is my Code:
> 
> O0 = riakc_obj:new(<<"test">>, <<"key0">>, <<"value0">>),
> MD0 = riakc_obj:get_update_metadata(O0),
> MD1 = riakc_obj:set_user_metadata_entry(MD0, {<<"ola_s">>,<<"nuno">>}),
> O1 = riakc_obj:update_metadata(O0, MD1),
> ok = riakc_pb_socket:put(Pid, O1).
> 
> My question is, how do I query this data without knowing the Key of the 
> Object.
> 
> Regards
> Antonio
> 
> 2015-04-02 16:10 GMT+01:00 Zeeshan Lakhani  >:
> Hello Antonio, 
> 
> You can insert an object and tag in the same operation, and you can query on 
> that tag via Riak Search.
> 
> Before writing the object, just apply/set the metadata accordingly. Here’s an 
> example in the Erlang client: 
> https://github.com/basho/riak-erlang-client/blob/7487c90275c88dbe8ef4c2fed6540864364ca3d4/src/riakc_pb_socket.erl#L3348
>  
> .
>  
> 
> Also, this can be done via http: 
> https://github.com/basho/yokozuna/blob/5868266b11f131d14c85495e50f899f3fe8158ba/riak_test/yokozuna_essential.erl#L281
>  
> .
> 
> Thanks.
> 
> Zeeshan Lakhani
> programmer | 
> software engineer at @basho | 
> org. member/founder of @papers_we_love | paperswelove.org 
> 
> twitter => @zeeshanlakhani
> 
>> On Apr 2, 2015, at 5:24 AM, Antonio Teixeira > > wrote:
>> 
>> I've been using Riak as my main database for a few months, now I've been 
>> experimenting with Riak Search 2.0 and for what I read in your documentation 
>> there is no way to insert a object and tag it in the same operation.
>> Right now we have an opaque object and we query them through secondary 
>> indexes, this is becoming unbearable.
>>  What we need is to store an object and 
>> tag(https://github.com/basho/yokozuna/blob/develop/docs/TAGGING.md 
>> ) it all in 
>> one step.
>> Our objects consist of erlang dictionaries and it would be a bit expensive 
>> (performance wise) to convert the Dictionary to a list and then to json in 
>> every database related operation.
>> We are using Riak 2.0.5, Erlang 17.0 and the PB Driver.
> 
> 

___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


Re: Deserialising nested Json into java object through Java -clinet

2015-04-07 Thread Santi Kumar
Thanks Brian for the response. Yah we r trying to write that Jackson
deserialiser  for our object and was struck there as we r not much familiar
just want to check if there is a direct way. We will either try to share
with you or try solr client directly

Thanks
Santi
 On Apr 7, 2015 9:37 PM, "Brian Roach"  wrote:

> Santi,
>
> There is nothing in the Riak Java client to do that, no.
>
> The result of a search query over the Riak protocol buffers API
> returns the fields you queried for as a series of key/value pairs,
> with the value always being a string. This is unfortunate when it
> comes to mapping those values back to a class (or just serializing
> them to JSON) if there was any non-string values (numbers or null).
>
> The Java client presents a returned document as a Map List> for this reason, the list being required as there could
> be multiple values for a single key.
>
> That said, it shouldn't be too difficult to write a custom
> deserializer for Jackson if you know what the results are going to
> look like in advance. If you could show a dump of the Map being
> returned by the Riak client we may be able to help with that. Another
> option would be to use a Solr client and query Solr directly rather
> than going through Riak.
>
> Thanks,
> Brian Roach
>
>
>
>
> On Tue, Apr 7, 2015 at 8:32 AM, Santi Kumar  wrote:
> > Hi
> > We have a Composite pojo which we are indexing into Riak search. If I see
> > the structure of the object in solr web console, it shows as nested json.
> > Through java client when we query it returns the Map and having
> difficulties
> > in converting it into java object. Is there a way in riak-java client to
> > return a pojo instead of Map and we dealing with jakson mappers?
> >
> > Thanks
> > Santi
> >
> > ___
> > riak-users mailing list
> > riak-users@lists.basho.com
> > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
> >
>
___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


Distributed joins and Riak search

2015-04-07 Thread Karri Niemelä
Do same limitations apply for yokozuna and SolrCloud?
(http://wiki.apache.org/solr/DistributedSearch#Distributed_Searching_Limitations,
 meaning no joins …)

?


___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


Re: Distributed joins and Riak search

2015-04-07 Thread Zeeshan Lakhani
Hello Karri,

That link is not describing SolrCloud, and Yokozuna does *not* use SolrCloud.

And, yes, those limitations do apply because we use Distributed Solr. For 
example, the join ticket is still open: 
https://issues.apache.org/jira/browse/LUCENE-3759 
.

Zeeshan Lakhani
programmer | 
software engineer at @basho | 
org. member/founder of @papers_we_love | paperswelove.org
twitter => @zeeshanlakhani

> On Apr 7, 2015, at 4:26 PM, Karri Niemelä  wrote:
> 
> Do same limitations apply for yokozuna and SolrCloud?
> (http://wiki.apache.org/solr/DistributedSearch#Distributed_Searching_Limitations
>  
> ,
>  meaning no joins …)
> 
> ?
> 
> 
> ___
> riak-users mailing list
> riak-users@lists.basho.com
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com