About Protocol Buffers

2014-06-23 Thread Alex De la rosa
Hi there,

I just installed RIAK 2.0 beta 1 and was playing with the Python library
using 'pbc' (Protocol Buffers).

test.py
+++++++++++
import riak
client = riak.RiakClient(host ='127.0.0.1', http_port = 8098, pb_port =
8087, protocol = 'pbc')
bucket = client.bucket('people')

key = bucket.new('alex', data={"username":"Alex","age":33})
key.store()

print bucket.get('alex').encoded_data
+++++++++++

it works perfectly and it prints {"username": "Alex", "age": 33} as it
should print.

However, I'm not using a proto file (person.proto) and compiling it into
binary for Python to use it... something like:

person.proto
+++++++++++
message Person {
  required string username = 1;
  required int32 age = 2;
}
+++++++++++

xxx.py
+++++++++++
import person_pb2
person = person_pb2.Person()
person.username = "Alex"
person.age = 33
data = person.SerializeToString()
+++++++++++

Am I using the 'pbc' interface wrong? however, on Riak's examples page is
done also without the "proto" file... I'm a bit confused at the moment as
it changed the way I normally would use Protocol Buffers.

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


Re: About Protocol Buffers

2014-06-23 Thread Alex De la rosa
Hi Sean,

Thanks for your quick reply, is what i suspected, moreover after checking
riak.proto file in the source. So mainly the contents to store (json or not
json) is not PB encoded semantically, but is encoded as a "body" field in
the Message. That's good though.

Another question... is there any estimated date for Riak 2.0 to be
released? I'm playing with 2.0 beta 1 and the "list" object is a must-have
for me (same as the "counter" object that can be found in Riak 1.4).

Is crucial for me to decide which technologies to use in my new project; so
far Riak 2.0 seems a great option, but I can not build under a beta.

Another question now that I talk about "counters"... how do you do it with
Python's PBC? I can see the functions: RiakClient.get_counter()
and RiakClient.update_counter()... but... how do you create a new counter?
how do you specify the special connotations to the bucket?

Thanks,
Alex


On Mon, Jun 23, 2014 at 4:38 PM, Sean Cribbs  wrote:

> Hi Alex,
>
> By default, the client assumes new objects use JSON as the encoding. The
> protocol buffers are only used on the wire to encode Riak's protocol. If
> you want to use your own protobuffs messages, I suggest two things:
>
> 1. Decide on a `content_type` property for each of your data types and be
> sure to assign that to each key as you create it. I've used
> 'application/pb-person' as an example below.
> 2. Register encoder and decoder functions [1] on the RiakClient object,
> like so:
>
> client.set_decoder('application/pb-person', Person.ParseFromString)
> client.set_encoder('application/pb-person', lambda x:
> x.SerializeToString())
>
> [1]
> http://riak-python-client.readthedocs.org/en/latest/client.html#serialization
>
> Cheers,
>
>
> On Mon, Jun 23, 2014 at 9:19 AM, Alex De la rosa 
> wrote:
>
>> Hi there,
>>
>> I just installed RIAK 2.0 beta 1 and was playing with the Python library
>> using 'pbc' (Protocol Buffers).
>>
>> test.py
>>
>> +++++++++++
>> import riak
>> client = riak.RiakClient(host ='127.0.0.1', http_port = 8098, pb_port =
>> 8087, protocol = 'pbc')
>> bucket = client.bucket('people')
>>
>> key = bucket.new('alex', data={"username":"Alex","age":33})
>> key.store()
>>
>> print bucket.get('alex').encoded_data
>>
>> +++++++++++
>>
>> it works perfectly and it prints {"username": "Alex", "age": 33} as it
>> should print.
>>
>> However, I'm not using a proto file (person.proto) and compiling it into
>> binary for Python to use it... something like:
>>
>> person.proto
>>
>> +++++++++++
>> message Person {
>>   required string username = 1;
>>   required int32 age = 2;
>> }
>>
>> +++++++++++
>>
>> xxx.py
>>
>> +++++++++++
>> import person_pb2
>> person = person_pb2.Person()
>> person.username = "Alex"
>> person.age = 33
>> data = person.SerializeToString()
>>
>> +++++++++++
>>
>> Am I using the 'pbc' interface wrong? however, on Riak's examples page is
>> done also without the "proto" file... I'm a bit confused at the moment as
>> it changed the way I normally would use Protocol Buffers.
>>
>> Thanks,
>> Alex
>>
>> ___
>> riak-users mailing list
>> riak-users@lists.basho.com
>> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>>
>>
>
>
> --
> Sean Cribbs 
> Software Engineer
> Basho Technologies, Inc.
> http://basho.com/
>
___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


Re: About Protocol Buffers

2014-06-23 Thread Alex De la rosa
Hi Luc,

Cool, thanks! I can see how to do it now:

bucket = client.bucket_type('counter_bucket').bucket('counters')

Will be checking it more to see what can I do that is not yet documented.

The Python documentation says at one point: "Some requests are only valid
over 'http', and will always be sent via those transports, regardless of
which protocol is preferred.". Can I know which requests are HTTP only? is
it for something in particular? or they will be made into PBC at some point?

Thanks,
Alex


On Mon, Jun 23, 2014 at 5:29 PM, Luc Perkins  wrote:

> Alex,
>
> It sounds like you're working mostly with the lower-level Python API at
> the moment, but if you want to use the higher-level parts of the client for
> interacting with Riak Data Types (sets, maps, and counters), there is a
> tutorial here:
>
>
> https://raw.githubusercontent.com/basho/basho_docs/2.0.0/source/languages/en/riak/dev/using/data-types.md
>
> You'll see the Python samples interspersed throughout. I know it's
> annoying because it's just raw Markdown at the moment, but this will be
> deployed to our normal docs site <http://docs.basho.com/riak/2.0.0beta1/>
>  soon.
>
> Hope that helps!
>
> Luc
>
>
> On Mon, Jun 23, 2014 at 4:54 PM, Alex De la rosa 
> wrote:
>
>> Hi Sean,
>>
>> Thanks for your quick reply, is what i suspected, moreover after checking
>> riak.proto file in the source. So mainly the contents to store (json or not
>> json) is not PB encoded semantically, but is encoded as a "body" field in
>> the Message. That's good though.
>>
>> Another question... is there any estimated date for Riak 2.0 to be
>> released? I'm playing with 2.0 beta 1 and the "list" object is a must-have
>> for me (same as the "counter" object that can be found in Riak 1.4).
>>
>> Is crucial for me to decide which technologies to use in my new project;
>> so far Riak 2.0 seems a great option, but I can not build under a beta.
>>
>> Another question now that I talk about "counters"... how do you do it
>> with Python's PBC? I can see the functions: RiakClient.get_counter()
>> and RiakClient.update_counter()... but... how do you create a new counter?
>> how do you specify the special connotations to the bucket?
>>
>> Thanks,
>> Alex
>>
>>
>> On Mon, Jun 23, 2014 at 4:38 PM, Sean Cribbs  wrote:
>>
>>> Hi Alex,
>>>
>>> By default, the client assumes new objects use JSON as the encoding. The
>>> protocol buffers are only used on the wire to encode Riak's protocol. If
>>> you want to use your own protobuffs messages, I suggest two things:
>>>
>>> 1. Decide on a `content_type` property for each of your data types and
>>> be sure to assign that to each key as you create it. I've used
>>> 'application/pb-person' as an example below.
>>>  2. Register encoder and decoder functions [1] on the RiakClient object,
>>> like so:
>>>
>>> client.set_decoder('application/pb-person', Person.ParseFromString)
>>> client.set_encoder('application/pb-person', lambda x:
>>> x.SerializeToString())
>>>
>>> [1]
>>> http://riak-python-client.readthedocs.org/en/latest/client.html#serialization
>>>
>>> Cheers,
>>>
>>>
>>> On Mon, Jun 23, 2014 at 9:19 AM, Alex De la rosa <
>>> alex.rosa@gmail.com> wrote:
>>>
>>>> Hi there,
>>>>
>>>> I just installed RIAK 2.0 beta 1 and was playing with the Python
>>>> library using 'pbc' (Protocol Buffers).
>>>>
>>>> test.py
>>>>
>>>> +++++++++++
>>>> import riak
>>>> client = riak.RiakClient(host ='127.0.0.1', http_port = 8098, pb_port =
>>>> 8087, protocol = 'pbc')
>>>> bucket = client.bucket('people')
>>>>
>>>> key = bucket.new('alex', data={"username":"Alex","age":33})
>>>> key.store()
>>>>
>>>> print bucket.get('alex').encoded_data
>>>>
>>>> +++++++++++
>>>>
>>>> it works perfectly and it prints {"username": "Alex", "age": 33} as it
>>>> should print.
>>>>
>>&

Re: About Protocol Buffers

2014-06-23 Thread Alex De la rosa
Hi Bret,

Thanks for your reply, I had used Riak since version 0.14 via HTTP... for
2.0 I decided to do the switch to PBC and I'm glad to hear all HTTP calls
has been migrated to PBC too :)

Does anybody know an estimate date for version 2.0 to be out? I'm starting
a new project and I would love to be able to use 2.0 as "list" buckets is a
great feature for my needs.

Thanks,
Alex



On Mon, Jun 23, 2014 at 9:57 PM, Brett Hazen  wrote:

> Alex -
>
> I suspect you may be looking at some older documentation.  AFAIK all HTTP
> functionality is now (Riak 2.0) supported via PBC so you can pick either
> transport or the other for all of your communication.  In the past there
> was some functionality available only via HTTP.  There are now some direct
> queries to the Solr API which are available only via HTTP, but that’s
> outside of Riak’s core [1].
>
> I’m sure those more in the know will correct me if I’ve misspoken.
>
> Brett
>
> [1] http://docs.basho.com/riak/2.0.0beta1/dev/advanced/search/
>
> On June 23, 2014 at 10:47:45 AM, Alex De la rosa (alex.rosa@gmail.com)
> wrote:
>
> Hi Luc,
>
> Cool, thanks! I can see how to do it now:
>
> bucket = client.bucket_type('counter_bucket').bucket('counters')
>
> Will be checking it more to see what can I do that is not yet documented.
>
> The Python documentation says at one point: "Some requests are only valid
> over 'http', and will always be sent via those transports, regardless of
> which protocol is preferred.". Can I know which requests are HTTP only? is
> it for something in particular? or they will be made into PBC at some point?
>
> Thanks,
> Alex
>
>
> On Mon, Jun 23, 2014 at 5:29 PM, Luc Perkins  wrote:
>
>> Alex,
>>
>> It sounds like you're working mostly with the lower-level Python API at
>> the moment, but if you want to use the higher-level parts of the client for
>> interacting with Riak Data Types (sets, maps, and counters), there is a
>> tutorial here:
>>
>>
>> https://raw.githubusercontent.com/basho/basho_docs/2.0.0/source/languages/en/riak/dev/using/data-types.md
>>
>> You'll see the Python samples interspersed throughout. I know it's
>> annoying because it's just raw Markdown at the moment, but this will be
>> deployed to our normal docs site <http://docs.basho.com/riak/2.0.0beta1/>
>>  soon.
>>
>> Hope that helps!
>>
>> Luc
>>
>>
>> On Mon, Jun 23, 2014 at 4:54 PM, Alex De la rosa > > wrote:
>>
>>> Hi Sean,
>>>
>>> Thanks for your quick reply, is what i suspected, moreover after
>>> checking riak.proto file in the source. So mainly the contents to store
>>> (json or not json) is not PB encoded semantically, but is encoded as a
>>> "body" field in the Message. That's good though.
>>>
>>> Another question... is there any estimated date for Riak 2.0 to be
>>> released? I'm playing with 2.0 beta 1 and the "list" object is a must-have
>>> for me (same as the "counter" object that can be found in Riak 1.4).
>>>
>>> Is crucial for me to decide which technologies to use in my new project;
>>> so far Riak 2.0 seems a great option, but I can not build under a beta.
>>>
>>> Another question now that I talk about "counters"... how do you do it
>>> with Python's PBC? I can see the functions: RiakClient.get_counter()
>>> and RiakClient.update_counter()... but... how do you create a new counter?
>>> how do you specify the special connotations to the bucket?
>>>
>>> Thanks,
>>> Alex
>>>
>>>
>>> On Mon, Jun 23, 2014 at 4:38 PM, Sean Cribbs  wrote:
>>>
>>>> Hi Alex,
>>>>
>>>> By default, the client assumes new objects use JSON as the encoding.
>>>> The protocol buffers are only used on the wire to encode Riak's protocol.
>>>> If you want to use your own protobuffs messages, I suggest two things:
>>>>
>>>> 1. Decide on a `content_type` property for each of your data types and
>>>> be sure to assign that to each key as you create it. I've used
>>>> 'application/pb-person' as an example below.
>>>> 2. Register encoder and decoder functions [1] on the RiakClient object,
>>>> like so:
>>>>
>>>> client.set_decoder('application/pb-person', Person.ParseFromString)
>>>> client.set_encoder('application/pb-person', lambda x:
>>>>

Re: About Protocol Buffers

2014-06-23 Thread Alex De la rosa
By the way, I have the following error using PBC on Riak 2.0:

test.py
--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--
import riak
client = riak.RiakClient(host ='127.0.0.1', http_port = 8098, pb_port =
8087, protocol = 'pbc')
bucket = client.bucket_type('counter_bucket').bucket('likes')
counter = bucket.new('Barcelona')
counter.increment(5)
--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--

OUTPUT:

Traceback (most recent call last):
  File "test.py", line 18, in 
bucket = client.bucket_type('counter_bucket').bucket('likes')
AttributeError: 'RiakClient' object has no attribute 'bucket_type'

What is wrong? I was following the instructions at:
https://raw.githubusercontent.com/basho/basho_docs/2.0.0/source/languages/en/riak/dev/using/data-types.md

Thanks,
Alex


On Mon, Jun 23, 2014 at 10:03 PM, Alex De la rosa 
wrote:

> Hi Bret,
>
> Thanks for your reply, I had used Riak since version 0.14 via HTTP... for
> 2.0 I decided to do the switch to PBC and I'm glad to hear all HTTP calls
> has been migrated to PBC too :)
>
> Does anybody know an estimate date for version 2.0 to be out? I'm starting
> a new project and I would love to be able to use 2.0 as "list" buckets is a
> great feature for my needs.
>
> Thanks,
> Alex
>
>
>
> On Mon, Jun 23, 2014 at 9:57 PM, Brett Hazen  wrote:
>
>> Alex -
>>
>> I suspect you may be looking at some older documentation.  AFAIK all HTTP
>> functionality is now (Riak 2.0) supported via PBC so you can pick either
>> transport or the other for all of your communication.  In the past there
>> was some functionality available only via HTTP.  There are now some direct
>> queries to the Solr API which are available only via HTTP, but that’s
>> outside of Riak’s core [1].
>>
>> I’m sure those more in the know will correct me if I’ve misspoken.
>>
>> Brett
>>
>> [1] http://docs.basho.com/riak/2.0.0beta1/dev/advanced/search/
>>
>> On June 23, 2014 at 10:47:45 AM, Alex De la rosa (alex.rosa@gmail.com)
>> wrote:
>>
>>  Hi Luc,
>>
>> Cool, thanks! I can see how to do it now:
>>
>> bucket = client.bucket_type('counter_bucket').bucket('counters')
>>
>> Will be checking it more to see what can I do that is not yet documented.
>>
>> The Python documentation says at one point: "Some requests are only valid
>> over 'http', and will always be sent via those transports, regardless of
>> which protocol is preferred.". Can I know which requests are HTTP only? is
>> it for something in particular? or they will be made into PBC at some point?
>>
>> Thanks,
>> Alex
>>
>>
>> On Mon, Jun 23, 2014 at 5:29 PM, Luc Perkins  wrote:
>>
>>> Alex,
>>>
>>> It sounds like you're working mostly with the lower-level Python API at
>>> the moment, but if you want to use the higher-level parts of the client for
>>> interacting with Riak Data Types (sets, maps, and counters), there is a
>>> tutorial here:
>>>
>>>
>>> https://raw.githubusercontent.com/basho/basho_docs/2.0.0/source/languages/en/riak/dev/using/data-types.md
>>>
>>> You'll see the Python samples interspersed throughout. I know it's
>>> annoying because it's just raw Markdown at the moment, but this will be
>>> deployed to our normal docs site
>>> <http://docs.basho.com/riak/2.0.0beta1/> soon.
>>>
>>> Hope that helps!
>>>
>>> Luc
>>>
>>>
>>> On Mon, Jun 23, 2014 at 4:54 PM, Alex De la rosa <
>>> alex.rosa@gmail.com> wrote:
>>>
>>>> Hi Sean,
>>>>
>>>> Thanks for your quick reply, is what i suspected, moreover after
>>>> checking riak.proto file in the source. So mainly the contents to store
>>>> (json or not json) is not PB encoded semantically, but is encoded as a
>>>> "body" field in the Message. That's good though.
>>>>
>>>> Another question... is there any estimated date for Riak 2.0 to be
>>>> released? I'm playing with 2.0 beta 1 and the "list" object is a must-have
>>>> for me (same as the "counter" object that can be found in Riak 1.4).
>>>>
>>>> Is crucial for me to decide which technologies to use in my new
>>>> project; so far Riak 

Re: About Protocol Buffers

2014-06-24 Thread Alex De la rosa
Hi Luc,

I tried your new solution and gives the same error. The problem is that
.bucket_type() doesn't exist:

Traceback (most recent call last):
  File "test.py", line 18, in 
bucket = client.bucket_type('counters').bucket('likes')
AttributeError: 'RiakClient' object has no attribute 'bucket_type'

I have Riak 2.0.0beta1 and riak-2.0.3-py2.7.egg as Python library.

Thanks,
Alex


On Tue, Jun 24, 2014 at 11:44 AM, Luc Perkins  wrote:

> Alex,
>
> There's a mistake in that tutorial that I need to fix. Early in the
> tutorial I instruct you to create a bucket type called *counters*, and
> then later on I use the name *counter_bucket*. Silly mistake on my part.
> If you establish that as the bucket type, it should work:
>
> *bucket = client.bucket_type('counters').bucket('likes')*
>
> Also be aware that you can call a bucket type that you set up to use
> counters anything that you'd like. The only reserved term for bucket types
> is *default*.
>
> Luc
>
>
> On Tue, Jun 24, 2014 at 12:31 AM, Alex De la rosa  > wrote:
>
>> By the way, I have the following error using PBC on Riak 2.0:
>>
>> test.py
>>
>> --+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--
>> import riak
>> client = riak.RiakClient(host ='127.0.0.1', http_port = 8098, pb_port =
>> 8087, protocol = 'pbc')
>> bucket = client.bucket_type('counter_bucket').bucket('likes')
>> counter = bucket.new('Barcelona')
>> counter.increment(5)
>>
>> --+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--
>>
>> OUTPUT:
>>
>> Traceback (most recent call last):
>>   File "test.py", line 18, in 
>> bucket = client.bucket_type('counter_bucket').bucket('likes')
>> AttributeError: 'RiakClient' object has no attribute 'bucket_type'
>>
>> What is wrong? I was following the instructions at:
>> https://raw.githubusercontent.com/basho/basho_docs/2.0.0/source/languages/en/riak/dev/using/data-types.md
>>
>> Thanks,
>> Alex
>>
>>
>> On Mon, Jun 23, 2014 at 10:03 PM, Alex De la rosa <
>> alex.rosa@gmail.com> wrote:
>>
>>> Hi Bret,
>>>
>>> Thanks for your reply, I had used Riak since version 0.14 via HTTP...
>>> for 2.0 I decided to do the switch to PBC and I'm glad to hear all HTTP
>>> calls has been migrated to PBC too :)
>>>
>>> Does anybody know an estimate date for version 2.0 to be out? I'm
>>> starting a new project and I would love to be able to use 2.0 as "list"
>>> buckets is a great feature for my needs.
>>>
>>> Thanks,
>>> Alex
>>>
>>>
>>>
>>> On Mon, Jun 23, 2014 at 9:57 PM, Brett Hazen  wrote:
>>>
>>>> Alex -
>>>>
>>>> I suspect you may be looking at some older documentation.  AFAIK all
>>>> HTTP functionality is now (Riak 2.0) supported via PBC so you can pick
>>>> either transport or the other for all of your communication.  In the past
>>>> there was some functionality available only via HTTP.  There are now some
>>>> direct queries to the Solr API which are available only via HTTP, but
>>>> that’s outside of Riak’s core [1].
>>>>
>>>> I’m sure those more in the know will correct me if I’ve misspoken.
>>>>
>>>> Brett
>>>>
>>>> [1] http://docs.basho.com/riak/2.0.0beta1/dev/advanced/search/
>>>>
>>>> On June 23, 2014 at 10:47:45 AM, Alex De la rosa (
>>>> alex.rosa@gmail.com) wrote:
>>>>
>>>>  Hi Luc,
>>>>
>>>> Cool, thanks! I can see how to do it now:
>>>>
>>>> bucket = client.bucket_type('counter_bucket').bucket('counters')
>>>>
>>>> Will be checking it more to see what can I do that is not yet
>>>> documented.
>>>>
>>>> The Python documentation says at one point: "Some requests are only
>>>> valid over 'http', and will always be sent via those transports, regardless
>>>> of which protocol is preferred.". Can I know which requests are HTTP only?
>>>> is it for something in particular? or they will be made into PBC at some
>>>> point?
>>>>
>>>> Thanks,
>>>> Alex

Re: About Protocol Buffers

2014-06-24 Thread Alex De la rosa
Sean,

Thank you very much for your answer; somehow I imagined the Python library
may not be updated with last code. Can't wait to be out as I can not fully
test everything I need for my project.

Thanks,
Alex


On Tue, Jun 24, 2014 at 3:35 PM, Sean Cribbs  wrote:

> Alex,
>
> Not all Riak 2.0 features have been merged to master on the Python client,
> including CRDTs. We are in final testing of that feature and will have a
> release candidate package of the client out soon.
>
>
> On Tue, Jun 24, 2014 at 5:26 AM, Alex De la rosa 
> wrote:
>
>> Hi Luc,
>>
>> I tried your new solution and gives the same error. The problem is that
>> .bucket_type() doesn't exist:
>>
>> Traceback (most recent call last):
>>   File "test.py", line 18, in 
>> bucket = client.bucket_type('counters').bucket('likes')
>> AttributeError: 'RiakClient' object has no attribute 'bucket_type'
>>
>> I have Riak 2.0.0beta1 and riak-2.0.3-py2.7.egg as Python library.
>>
>> Thanks,
>> Alex
>>
>>
>> On Tue, Jun 24, 2014 at 11:44 AM, Luc Perkins  wrote:
>>
>>> Alex,
>>>
>>> There's a mistake in that tutorial that I need to fix. Early in the
>>> tutorial I instruct you to create a bucket type called *counters*, and
>>> then later on I use the name *counter_bucket*. Silly mistake on my
>>> part. If you establish that as the bucket type, it should work:
>>>
>>> *bucket = client.bucket_type('counters').bucket('likes')*
>>>
>>> Also be aware that you can call a bucket type that you set up to use
>>> counters anything that you'd like. The only reserved term for bucket types
>>> is *default*.
>>>
>>> Luc
>>>
>>>
>>> On Tue, Jun 24, 2014 at 12:31 AM, Alex De la rosa <
>>> alex.rosa@gmail.com> wrote:
>>>
>>>> By the way, I have the following error using PBC on Riak 2.0:
>>>>
>>>> test.py
>>>>
>>>> --+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--
>>>> import riak
>>>> client = riak.RiakClient(host ='127.0.0.1', http_port = 8098, pb_port =
>>>> 8087, protocol = 'pbc')
>>>> bucket = client.bucket_type('counter_bucket').bucket('likes')
>>>> counter = bucket.new('Barcelona')
>>>> counter.increment(5)
>>>>
>>>> --+------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--
>>>>
>>>> OUTPUT:
>>>>
>>>> Traceback (most recent call last):
>>>>   File "test.py", line 18, in 
>>>> bucket = client.bucket_type('counter_bucket').bucket('likes')
>>>> AttributeError: 'RiakClient' object has no attribute 'bucket_type'
>>>>
>>>> What is wrong? I was following the instructions at:
>>>> https://raw.githubusercontent.com/basho/basho_docs/2.0.0/source/languages/en/riak/dev/using/data-types.md
>>>>
>>>> Thanks,
>>>> Alex
>>>>
>>>>
>>>> On Mon, Jun 23, 2014 at 10:03 PM, Alex De la rosa <
>>>> alex.rosa@gmail.com> wrote:
>>>>
>>>>> Hi Bret,
>>>>>
>>>>> Thanks for your reply, I had used Riak since version 0.14 via HTTP...
>>>>> for 2.0 I decided to do the switch to PBC and I'm glad to hear all HTTP
>>>>> calls has been migrated to PBC too :)
>>>>>
>>>>> Does anybody know an estimate date for version 2.0 to be out? I'm
>>>>> starting a new project and I would love to be able to use 2.0 as "list"
>>>>> buckets is a great feature for my needs.
>>>>>
>>>>> Thanks,
>>>>> Alex
>>>>>
>>>>>
>>>>>
>>>>> On Mon, Jun 23, 2014 at 9:57 PM, Brett Hazen  wrote:
>>>>>
>>>>>> Alex -
>>>>>>
>>>>>> I suspect you may be looking at some older documentation.  AFAIK all
>>>>>> HTTP functionality is now (Riak 2.0) supported via PBC so you can pick
>>>>>> either transport or the other for all of your communication.  In the past
>>>>>> there was some functionality available only via HTTP.  There are now some
>>>>

Python client: Connection pool

2014-06-25 Thread Alex De la rosa
Hi there,

Using the Python client, in the documentation I can read this:

"The client maintains a connection pool behind the scenes, one for each
protocol. Connections are opened as-needed; a random node is selected when
a new connection is requested."

Imagine that I create my connection like this:

client = riak.RiakClient(protocol='pbc', nodes=[{'host':'X.X.X.1',
'http_port':8098,'pb_port':8087},{'host':'X.X.X.2','http_port':8098,
'pb_port':8087},{'host':'X.X.X.3','http_port':8098,'pb_port':8087},{'host':
'X.X.X.4','http_port':8098,'pb_port':8087},{'host':'X.X.X.5','http_port'
:8098,'pb_port':8087}])

Specifying the 5 servers in my cluster... Every time that do a request
(PUT/GET/DELETE) is going to use a randomized host from the list? Also...
what if for example I add server X.X.X.6 and X.X.X.7? do I have to manually
edit my connection string to reflect those changes? Is there a way to
automatically use any node in the cluster without having to specify them
manually?

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


Possible bug in Python client?

2014-06-25 Thread Alex De la rosa
Hi there,

I was testing 2i via PBC on Python and I found a wrong behaviour, this is
my code:

---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---

import riak
client = riak.RiakClient(protocol='pbc',
nodes=[{'host':'127.0.0.1','http_port':8098,'pb_port':8087}])
bucket = client.bucket('accounts')
key = bucket.new('alex', data={"name":"Alex","age":25,"sex":"male"})
key.add_index('age_int', 25)
key.add_index('sex_bin', 'male')
key.store()
results = bucket.get_index('sex_bin', 'male', max_results = 10)
print results.results
if results.has_next_page():

---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---

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


Fwd: Possible bug in Python client?

2014-06-25 Thread Alex De la rosa
** SORRY, WAS SEND BEFORE I FINISHED **

Hi there,

I was testing 2i via PBC on Python and I found a wrong behaviour, this is
my code:

---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---

import riak
client = riak.RiakClient(protocol='pbc',
nodes=[{'host':'127.0.0.1','http_port':8098,'pb_port':8087}])
bucket = client.bucket('accounts')
key = bucket.new('alex', data={"name":"Alex","age":25,"sex":"male"})
key.add_index('age_int', 25)
key.add_index('sex_bin', 'male')
key.store()
results = bucket.get_index('sex_bin', 'male', max_results = 10)
print results.results
if results.has_next_page():
more = bucket.get_index('sex_bin', 'm', 'o', max_results = 10,
continuation = results.continuation)
print more.results

---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---

This is the output:
['alex']
['alex']

Although there is only 1 key that matches the 2i, results.has_next_page()
has value TRUE and results.continuation is empty... however, it enter the
IF and requests more keys getting "alex" key again (and that could be on
and on and on)

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


Re: Python client: Connection pool

2014-06-25 Thread Alex De la rosa
Hi Sean,

Thank you very much for your answer. So although I put 5 nodes in the
connection string, only 1 would be use for the overall process (PUT, PUT,
PUT, GET, etc...) until the end of the execution.

My second question was, if I have 5 nodes initially and i put them on my
connection string, and later I put 2 more nodes in the server but I didn't
put them in the connection string, would those 2 new nodes be available in
the pool? or only the ones specified?

Thanks,
Alex


On Wed, Jun 25, 2014 at 4:34 PM, Sean Cribbs  wrote:

> Alex,
>
> No, it will only randomize the node when *opening* a connection. After
> that, it just uses what is first available in the pool.
>
> We have an outstanding plan to support auto-configuring clients, but that
> work did not make it into the 2.0 cycle.
>
>
> On Wed, Jun 25, 2014 at 7:18 AM, Alex De la rosa 
> wrote:
>
>> Hi there,
>>
>> Using the Python client, in the documentation I can read this:
>>
>> "The client maintains a connection pool behind the scenes, one for each
>> protocol. Connections are opened as-needed; a random node is selected when
>> a new connection is requested."
>>
>> Imagine that I create my connection like this:
>>
>> client = riak.RiakClient(protocol='pbc', nodes=[{'host':'X.X.X.1',
>> 'http_port':8098,'pb_port':8087},{'host':'X.X.X.2','http_port':8098,
>> 'pb_port':8087},{'host':'X.X.X.3','http_port':8098,'pb_port':8087},{
>> 'host':'X.X.X.4','http_port':8098,'pb_port':8087},{'host':'X.X.X.5',
>> 'http_port':8098,'pb_port':8087}])
>>
>> Specifying the 5 servers in my cluster... Every time that do a request
>> (PUT/GET/DELETE) is going to use a randomized host from the list? Also...
>> what if for example I add server X.X.X.6 and X.X.X.7? do I have to manually
>> edit my connection string to reflect those changes? Is there a way to
>> automatically use any node in the cluster without having to specify them
>> manually?
>>
>> Thanks,
>> Alex
>>
>> ___
>> riak-users mailing list
>> riak-users@lists.basho.com
>> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>>
>>
>
>
> --
> Sean Cribbs 
> Software Engineer
> Basho Technologies, Inc.
> http://basho.com/
>
___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


Riak for streaming video

2014-06-26 Thread Alex De la rosa
Hi there,

Imagine that I want to use Riak for a video service like Youtube and I save
the video file in Riak... is there a way to stream the contents of 1 key? I
know we can stream keys... but what about its content?

It would be pretty troublesome to have to wait for the full data to be
downloaded $bucket->get('myvideo') to be able to serve it... as they can be
pretty big files.

Is there any recommendation to store/get big files like videos? or it would
be better to use some other system than Riak for the job?

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


Re: Riak for streaming video

2014-06-26 Thread Alex De la rosa
Hi Hector,

I see, I always thought that Riak CS was the same as Riak just that you run
it in Amazon S3... they are actually different...

So... if I have a social network and one of the features is that they can
share video, I would use a normal Riak cluster for the webapp and data and
a Riak CS cluster for the video storage/streaming... am I right?

By the way, couldn't this "range header" be implemented in standard Riak?
might be a good thing to have so you don't need 2 clusters for this matter.

Thanks,
Alex


On Thu, Jun 26, 2014 at 9:28 PM, Hector Castro  wrote:

> Hi Alex,
>
> For this type of problem, you may want to look into Riak CS. [0] It is
> an object storage platform built on top of Riak.
>
> When you GET an object from Riak CS, you can specify a Range header to
> get the object by its byte offset. [1]
>
> --
> Hector
>
> [0] http://docs.basho.com/riakcs/latest/
> [1]
> http://docs.basho.com/riakcs/latest/references/apis/storage/s3/RiakCS-GET-Object/#Examples
>
> On Thu, Jun 26, 2014 at 3:22 PM, Alex De la rosa
>  wrote:
> > Hi there,
> >
> > Imagine that I want to use Riak for a video service like Youtube and I
> save
> > the video file in Riak... is there a way to stream the contents of 1
> key? I
> > know we can stream keys... but what about its content?
> >
> > It would be pretty troublesome to have to wait for the full data to be
> > downloaded $bucket->get('myvideo') to be able to serve it... as they can
> be
> > pretty big files.
> >
> > Is there any recommendation to store/get big files like videos? or it
> would
> > be better to use some other system than Riak for the job?
> >
> > Thanks,
> > Alex
> >
> > ___
> > 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: Riak for streaming video

2014-06-26 Thread Alex De la rosa
Hi Hector,

Thanks for your response :) highly appreciated. I have more questions
though.

Riak CS has to be implemented in Amazon S3? Or can I house it myself with
own managed servers?

What is the limit for an object in Standard Riak? Large objects should go
to Riak CS, but what would be a limit for the Standard Riak? I may want to
save pictures, for example, in binary data... not a RAW version, but like
processed photo uploads from users... I think Standard Riak can hold that
with no problem, but it would be good to know the size limit for a key's
content.

Thanks,
Alex


On Thu, Jun 26, 2014 at 10:45 PM, Hector Castro  wrote:

> Hey Alex,
>
> My response are inline below.
>
> --
> Hector
>
>
> On Thu, Jun 26, 2014 at 4:26 PM, Alex De la rosa
>  wrote:
> > Hi Hector,
> >
> > I see, I always thought that Riak CS was the same as Riak just that you
> run
> > it in Amazon S3... they are actually different...
>
> Correct, but it is important to note that Riak is still at the core of
> Riak CS.
>
> > So... if I have a social network and one of the features is that they can
> > share video, I would use a normal Riak cluster for the webapp and data
> and a
> > Riak CS cluster for the video storage/streaming... am I right?
>
> That seems like a reasonable conclusion.
>
> Riak is fundamentally a distributed key/value store for low latency
> access to smaller pieces of data. Riak CS is an S3/Swift
> API-compatible object storage platform with a little higher request
> latency, but also the added ability to house very large objects
> (backups, raw images, video).
>
> > By the way, couldn't this "range header" be implemented in standard Riak?
> > might be a good thing to have so you don't need 2 clusters for this
> matter.
>
> It could some day. Right now, separating the clusters is best because
> tuning a single cluster for both use cases would be difficult.
>
> > Thanks,
> > Alex
> >
> >
> > On Thu, Jun 26, 2014 at 9:28 PM, Hector Castro  wrote:
> >>
> >> Hi Alex,
> >>
> >> For this type of problem, you may want to look into Riak CS. [0] It is
> >> an object storage platform built on top of Riak.
> >>
> >> When you GET an object from Riak CS, you can specify a Range header to
> >> get the object by its byte offset. [1]
> >>
> >> --
> >> Hector
> >>
> >> [0] http://docs.basho.com/riakcs/latest/
> >> [1]
> >>
> http://docs.basho.com/riakcs/latest/references/apis/storage/s3/RiakCS-GET-Object/#Examples
> >>
> >> On Thu, Jun 26, 2014 at 3:22 PM, Alex De la rosa
> >>  wrote:
> >> > Hi there,
> >> >
> >> > Imagine that I want to use Riak for a video service like Youtube and I
> >> > save
> >> > the video file in Riak... is there a way to stream the contents of 1
> >> > key? I
> >> > know we can stream keys... but what about its content?
> >> >
> >> > It would be pretty troublesome to have to wait for the full data to be
> >> > downloaded $bucket->get('myvideo') to be able to serve it... as they
> can
> >> > be
> >> > pretty big files.
> >> >
> >> > Is there any recommendation to store/get big files like videos? or it
> >> > would
> >> > be better to use some other system than Riak for the job?
> >> >
> >> > Thanks,
> >> > Alex
> >> >
> >> > ___
> >> > 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


Help on bucket quorums

2014-06-28 Thread Alex De la rosa
Hi there,

Can somebody help me understand a bit better the bucket quorums? I will use
the Python API to write code examples:

Imagine we are building a web app like twitter, and we want fast read
(although not need to be consistent) and safe writings, this R/W
combination is appropriate?

bucket = client.bucket('twits')

bucket.r = 1
bucket.w = 3

# OR

bucket.set_property('r', 1)
bucket.set_property('w', 3)

Which method is better to use? or are just exactly the same?

Imagine that in this new case, we want to focus on writing fast (normally
we will write more "twits" than read them)... which would be the most
appropriate/suggested quorums?

Also, what's really the difference between "r" and "pr"? what is a "primary
replica"?

If i set up bucket.w = 1, it will still do the 3 copies (n_val) in the
background but will reply "true" once 1 copy is saved, right?

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


Re: Help on bucket quorums

2014-06-28 Thread Alex De la rosa
Hi John, Hi Brett,

Thanks for the links! I will take a look and see if I figure it out ;)

Greetings,
Alex


On Sat, Jun 28, 2014 at 6:20 PM, John Daily  wrote:

> I don't have time at the moment to respond in more detail, I'm afraid, but
> you should find this blog series quite useful.
>
> http://basho.com/understanding-riaks-configurable-behaviors-part-1/
>
>
> Sent from my iPhone
>
> On Jun 28, 2014, at 5:56 AM, Alex De la rosa 
> wrote:
>
> Hi there,
>
> Can somebody help me understand a bit better the bucket quorums? I will
> use the Python API to write code examples:
>
> Imagine we are building a web app like twitter, and we want fast read
> (although not need to be consistent) and safe writings, this R/W
> combination is appropriate?
>
> bucket = client.bucket('twits')
>
> bucket.r = 1
> bucket.w = 3
>
> # OR
>
> bucket.set_property('r', 1)
> bucket.set_property('w', 3)
>
> Which method is better to use? or are just exactly the same?
>
> Imagine that in this new case, we want to focus on writing fast (normally
> we will write more "twits" than read them)... which would be the most
> appropriate/suggested quorums?
>
> Also, what's really the difference between "r" and "pr"? what is a
> "primary replica"?
>
> If i set up bucket.w = 1, it will still do the 3 copies (n_val) in the
> background but will reply "true" once 1 copy is saved, right?
>
> Thanks,
> Alex
>
> ___
>
> 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: Help on bucket quorums

2014-06-28 Thread Alex De la rosa
Hi Sean,

Thank you very much for your explanation :) looks much clearer now.

So... is not viable to set anything to 0 as it would make no sense and
fail, and also is not appropriate to set anything to the same value as
"n_value" (in this case 3) as there would be false negatives... so the
adjustments should be between 1 and 2 (the default)... meaning that we can
only increase its speed a bit setting some value to 1 (r = 1 if we want to
read fast, w = 1 if we want to write fast)

For what I see, makes no much sense to change PR and PW... and DW only if
we really really really want strong consistency. Leaving again just the
real need to set "r" and "w" if we want to speed up any of the processes.

Am I right?

Cheers,
Alex


On Sat, Jun 28, 2014 at 8:41 PM, Sean Cribbs  wrote:

>
> On Sat, Jun 28, 2014 at 4:55 AM, Alex De la rosa 
> wrote:
>
>> Hi there,
>>
>> Can somebody help me understand a bit better the bucket quorums? I will
>> use the Python API to write code examples:
>>
>> Imagine we are building a web app like twitter, and we want fast read
>> (although not need to be consistent) and safe writings, this R/W
>> combination is appropriate?
>>
>> bucket = client.bucket('twits')
>>
>> bucket.r = 1
>> bucket.w = 3
>>
>> # OR
>>
>> bucket.set_property('r', 1)
>> bucket.set_property('w', 3)
>>
>> Which method is better to use? or are just exactly the same?
>>
>>
> The pseudo-properties in the first example are exactly the same as the
> set_property() calls in the second, just a convenience. Generally I
> wouldn't recommend W=3 because it will tend to create false negatives under
> heavy load, W=2 (the default) should be sufficient. Keep in mind that R=1
> with notfound_ok = true (the default) can tend to result in false negative
> responses as well.
>
>
>> Imagine that in this new case, we want to focus on writing fast (normally
>> we will write more "twits" than read them)... which would be the most
>> appropriate/suggested quorums?
>>
>> Also, what's really the difference between "r" and "pr"? what is a
>> "primary replica"?
>>
>>
> Primaries are the replicas (nodes) that are the canonical owners the data,
> but Riak will let you read and write even if they are not available. If
> they are not available, fallback replicas (non-owner nodes) will take over
> in their place. Setting PR or PW > 0 will result in failures if that many
> primaries are not available (the node is down or partitioned from the node
> that receives the request).
>
>
>> If i set up bucket.w = 1, it will still do the 3 copies (n_val) in the
>> background but will reply "true" once 1 copy is saved, right?
>>
>>
> Yes. Keep in mind W is a fast-path response, i.e. "I received the request
> to write", whereas DW is a "I saved the key to the storage engine". There
> is no practical reason for DW ever to be 0, in fact I think it is
> disallowed (or silently upgraded to 1).
>
>
>> Thanks,
>> Alex
>>
>> ___
>> riak-users mailing list
>> riak-users@lists.basho.com
>> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>>
>>
>
>
> --
> Sean Cribbs 
> Software Engineer
> Basho Technologies, Inc.
> http://basho.com/
>
___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


Re: Riak for streaming video

2014-06-29 Thread Alex De la rosa
Hi there,

One more question regarding Riak CS, does it behave like standard Riak?
storing 3 copies (default) and needing a minimum of 5 servers to operate?

Cheers,
Alex


On Fri, Jun 27, 2014 at 2:43 AM, Jared Morrow  wrote:

> Luwak is definitely EOL'd and RiakCS is our large object store going
> forward.  It is a far superior design compared to Luwak and handles very
> large file sizes.
>
>
>
> On Thursday, June 26, 2014, Jason Campbell  wrote:
>
>> Riak CS is designed to be the same interface as Amazon S3.  It can be run
>> anywhere you can run Riak.
>>
>> Think of it as a way to run your own S3.
>>
>> I think the hard limit on Riak objects is 50MB, but the recommended size
>> is less than 1MB per object.  The main reason for that is latency.  It's
>> faster to get 100x1MB chunks from the entire cluster than it is to get
>> 1x100MB chunk from a single server.  It's also easier for disks to pull a
>> 1MB object without delaying any other requests than pulling a 100MB object,
>> which may end up queuing other requests made after.
>>
>> There used to be a project called luwak that was built into Riak and
>> handled chunking files like this, but it has been EOL'd.  Perhaps someone
>> can shed some light on this.  Is RiakCS the final solution for binary
>> storage?  Or is there another way to store larger objects in Riak?
>>
>> RiakCS is wonderful, but it does seem overkill for some uses where you
>> don't need to expose an S3 interface, don't need the S3 permission
>> structure, and really just want file storage.
>>
>> - Original Message -
>> From: "Alex De la rosa" 
>> To: "Hector Castro" 
>> Cc: "riak-users" 
>> Sent: Friday, 27 June, 2014 6:55:13 AM
>> Subject: Re: Riak for streaming video
>>
>>
>>
>> Hi Hector,
>>
>>
>> Thanks for your response :) highly appreciated. I have more questions
>> though.
>>
>>
>> Riak CS has to be implemented in Amazon S3? Or can I house it myself with
>> own managed servers?
>>
>>
>> What is the limit for an object in Standard Riak? Large objects should go
>> to Riak CS, but what would be a limit for the Standard Riak? I may want to
>> save pictures, for example, in binary data... not a RAW version, but like
>> processed photo uploads from users... I think Standard Riak can hold that
>> with no problem, but it would be good to know the size limit for a key's
>> content.
>>
>>
>> Thanks,
>> Alex
>>
>>
>>
>> On Thu, Jun 26, 2014 at 10:45 PM, Hector Castro < hec...@basho.com >
>> wrote:
>>
>>
>> Hey Alex,
>>
>> My response are inline below.
>>
>> --
>> Hector
>>
>>
>>
>> On Thu, Jun 26, 2014 at 4:26 PM, Alex De la rosa
>> < alex.rosa@gmail.com > wrote:
>> > Hi Hector,
>> >
>> > I see, I always thought that Riak CS was the same as Riak just that you
>> run
>> > it in Amazon S3... they are actually different...
>>
>> Correct, but it is important to note that Riak is still at the core of
>> Riak CS.
>>
>>
>> > So... if I have a social network and one of the features is that they
>> can
>> > share video, I would use a normal Riak cluster for the webapp and data
>> and a
>> > Riak CS cluster for the video storage/streaming... am I right?
>>
>> That seems like a reasonable conclusion.
>>
>> Riak is fundamentally a distributed key/value store for low latency
>> access to smaller pieces of data. Riak CS is an S3/Swift
>> API-compatible object storage platform with a little higher request
>> latency, but also the added ability to house very large objects
>> (backups, raw images, video).
>>
>>
>> > By the way, couldn't this "range header" be implemented in standard
>> Riak?
>> > might be a good thing to have so you don't need 2 clusters for this
>> matter.
>>
>> It could some day. Right now, separating the clusters is best because
>> tuning a single cluster for both use cases would be difficult.
>>
>>
>>
>> > Thanks,
>> > Alex
>> >
>> >
>> > On Thu, Jun 26, 2014 at 9:28 PM, Hector Castro < hec...@basho.com >
>> wrote:
>> >>
>> >> Hi Alex,
>> >>
>> >> For this type of problem, you may want to look into Riak CS. [0] It is
>> >> an object storage platform built on top of Riak.
>> >>

Question about counters

2014-06-29 Thread Alex De la rosa
Hi there,

I have a question about something that just came up to my mind... can we
determine which counter is higher in a bucket? For example:

# Taking the FIFA World Cup as example:

bucket = client.bucket_type('counter_bucket').bucket('goals')
counter = bucket.new('Neymar')
counter.increment(4)
counter = bucket.new('Messi')
counter.increment(4)
counter = bucket.new('JamesRodriguez')
counter.increment(5)

Is there any way (without using MapReduce) to get the top scorer of the
World Cup? or a descendent ordered list of the keys by its value?

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


Re: Riak for streaming video

2014-06-30 Thread Alex De la rosa
Hi Jared,

Thanks for your explanation and links... my next question is... Is
Stanchion not a single-point of failure? One of the things I like in
Standard Riak is that every node has the same level, there are no masters,
no slaves... if one fail it doesn't matter, the rest can do the job. If
Riak CS requires un especial node, what happens if that one fails? system
is down then? Can you configure the system with more than one Stanchion
node?

Cheers,
Alex


On Mon, Jun 30, 2014 at 7:37 AM, Jared Morrow  wrote:

> Alex,
>
> That is correct.  There are some additional docs we have on load-balancing
> and such on our docs page
> http://docs.basho.com/riakcs/latest/cookbooks/configuration/Load-Balancing-and-Proxy-Configuration/,
> but generally it acts and feels like a Riak installation.  One additional
> special node is required (Stanchion) and that is also described on our docs
> page
> http://docs.basho.com/riakcs/latest/cookbooks/configuration/Configuring-Stanchion/
> .
>
> Keep the questions coming, if I don't know the details I'll hand off to
> Engineers more knowledgable with RiakCS.
>
> -Jared
>
>
>
>
> On Sun, Jun 29, 2014 at 5:58 AM, Alex De la rosa 
> wrote:
>
>> Hi there,
>>
>> One more question regarding Riak CS, does it behave like standard Riak?
>> storing 3 copies (default) and needing a minimum of 5 servers to operate?
>>
>> Cheers,
>> Alex
>>
>>
>> On Fri, Jun 27, 2014 at 2:43 AM, Jared Morrow  wrote:
>>
>>> Luwak is definitely EOL'd and RiakCS is our large object store going
>>> forward.  It is a far superior design compared to Luwak and handles very
>>> large file sizes.
>>>
>>>
>>>
>>> On Thursday, June 26, 2014, Jason Campbell  wrote:
>>>
>>>> Riak CS is designed to be the same interface as Amazon S3.  It can be
>>>> run anywhere you can run Riak.
>>>>
>>>> Think of it as a way to run your own S3.
>>>>
>>>> I think the hard limit on Riak objects is 50MB, but the recommended
>>>> size is less than 1MB per object.  The main reason for that is latency.
>>>>  It's faster to get 100x1MB chunks from the entire cluster than it is to
>>>> get 1x100MB chunk from a single server.  It's also easier for disks to pull
>>>> a 1MB object without delaying any other requests than pulling a 100MB
>>>> object, which may end up queuing other requests made after.
>>>>
>>>> There used to be a project called luwak that was built into Riak and
>>>> handled chunking files like this, but it has been EOL'd.  Perhaps someone
>>>> can shed some light on this.  Is RiakCS the final solution for binary
>>>> storage?  Or is there another way to store larger objects in Riak?
>>>>
>>>> RiakCS is wonderful, but it does seem overkill for some uses where you
>>>> don't need to expose an S3 interface, don't need the S3 permission
>>>> structure, and really just want file storage.
>>>>
>>>> - Original Message -
>>>> From: "Alex De la rosa" 
>>>> To: "Hector Castro" 
>>>> Cc: "riak-users" 
>>>> Sent: Friday, 27 June, 2014 6:55:13 AM
>>>> Subject: Re: Riak for streaming video
>>>>
>>>>
>>>>
>>>> Hi Hector,
>>>>
>>>>
>>>> Thanks for your response :) highly appreciated. I have more questions
>>>> though.
>>>>
>>>>
>>>> Riak CS has to be implemented in Amazon S3? Or can I house it myself
>>>> with own managed servers?
>>>>
>>>>
>>>> What is the limit for an object in Standard Riak? Large objects should
>>>> go to Riak CS, but what would be a limit for the Standard Riak? I may want
>>>> to save pictures, for example, in binary data... not a RAW version, but
>>>> like processed photo uploads from users... I think Standard Riak can hold
>>>> that with no problem, but it would be good to know the size limit for a
>>>> key's content.
>>>>
>>>>
>>>> Thanks,
>>>> Alex
>>>>
>>>>
>>>>
>>>> On Thu, Jun 26, 2014 at 10:45 PM, Hector Castro < hec...@basho.com >
>>>> wrote:
>>>>
>>>>
>>>> Hey Alex,
>>>>
>>>> My response are inline below.
>>>>
>>>> --
>>>> Hector
>>>>
>>>>

Re: Question about counters

2014-06-30 Thread Alex De la rosa
A "set" may not be a good solution if you have many counters getting
updated at once and you should do the sorting (if possible) before saving
the "set" back into RIAK.

The goal scoring was a very simple/small example... but imagine you want to
do Twitter's Trending Topics counting which twits has more comments (if we
have a "comments" counter)... will be too massive to save it all in a "set".

I guess that MapReduce will be the way in this case.

Cheers,
Alex


On Mon, Jun 30, 2014 at 12:14 AM, Alexander Sicular 
wrote:

> Not that I know of. I believe keys are independent in this regard. Basho
> is introducing sets in riak 2.0 but I don't think they will bee sorted sets
> like in redis.
>
> -Alexander
>
> @siculars
> http://siculars.posthaven.com
>
> Sent from my iRotaryPhone
>
> On Jun 29, 2014, at 15:54, Alex De la rosa 
> wrote:
>
> Hi there,
>
> I have a question about something that just came up to my mind... can we
> determine which counter is higher in a bucket? For example:
>
> # Taking the FIFA World Cup as example:
>
> bucket = client.bucket_type('counter_bucket').bucket('goals')
> counter = bucket.new('Neymar')
> counter.increment(4)
> counter = bucket.new('Messi')
> counter.increment(4)
> counter = bucket.new('JamesRodriguez')
> counter.increment(5)
>
> Is there any way (without using MapReduce) to get the top scorer of the
> World Cup? or a descendent ordered list of the keys by its value?
>
> Cheers,
> Alex
>
> ___
> 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: Question about counters

2014-06-30 Thread Alex De la rosa
Hi Alexander,

Very nice answer, interesting! Can you explain how to do this with Riak
Search? I had to admit I never used it in the past (Riak 0.14 and Riak
1.x), and once installed Riak 2.0 and tried to enable it my Riak cluster
was not starting (I guess I missed something in the configuration).

Cheers,
Alex


On Mon, Jun 30, 2014 at 10:28 AM, Christian Dahlqvist 
wrote:

> Hi Alex,
>
> In Riak 2.0 you can create a map data type that can contain a number of
> related counters. If you have a limited number of named counters, e.g. for
> scorers in the World Cup, this would allow you to update multiple counters
> using a single operation and read all of then as a single key retrieval.
>
> If you however have a large number of counters that can not fit into a
> single value, this approach will not work. Instead of trying to retrieve
> the top values through MapReduce, you could instead enable Riak Search 2.0
> for the bucket and query the largest values through Solr, which should be
> more efficient and flexible than using MapReduce.
>
> Best regards,
>
> Christian
>
>
> On Mon, Jun 30, 2014 at 7:17 AM, Alex De la rosa 
> wrote:
>
>> A "set" may not be a good solution if you have many counters getting
>> updated at once and you should do the sorting (if possible) before saving
>> the "set" back into RIAK.
>>
>> The goal scoring was a very simple/small example... but imagine you want
>> to do Twitter's Trending Topics counting which twits has more comments (if
>> we have a "comments" counter)... will be too massive to save it all in a
>> "set".
>>
>> I guess that MapReduce will be the way in this case.
>>
>> Cheers,
>> Alex
>>
>>
>> On Mon, Jun 30, 2014 at 12:14 AM, Alexander Sicular 
>> wrote:
>>
>>> Not that I know of. I believe keys are independent in this regard. Basho
>>> is introducing sets in riak 2.0 but I don't think they will bee sorted sets
>>> like in redis.
>>>
>>> -Alexander
>>>
>>> @siculars
>>> http://siculars.posthaven.com
>>>
>>> Sent from my iRotaryPhone
>>>
>>> On Jun 29, 2014, at 15:54, Alex De la rosa 
>>> wrote:
>>>
>>> Hi there,
>>>
>>> I have a question about something that just came up to my mind... can we
>>> determine which counter is higher in a bucket? For example:
>>>
>>> # Taking the FIFA World Cup as example:
>>>
>>> bucket = client.bucket_type('counter_bucket').bucket('goals')
>>> counter = bucket.new('Neymar')
>>> counter.increment(4)
>>> counter = bucket.new('Messi')
>>> counter.increment(4)
>>> counter = bucket.new('JamesRodriguez')
>>> counter.increment(5)
>>>
>>> Is there any way (without using MapReduce) to get the top scorer of the
>>> World Cup? or a descendent ordered list of the keys by its value?
>>>
>>> Cheers,
>>> Alex
>>>
>>> ___
>>> 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
>>
>>
>
___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


Cluster security

2014-06-30 Thread Alex De la rosa
Hi there,

Imaging the following IP configuration for Riak 2.0:

# /etc/riak/riak.conf

nodename = riak@111.222.333.1
listener.http.internal = 127.0.0.1:8098
listener.protobuf.internal = 127.0.0.1:8087
listener.https.internal = 127.0.0.1:8098

I put the server's real IP in the nodename so they can join/communicate
with each other but then I limit any HTTP/PB communication to the localhost
so nobody can mess with the node from outside (we assume I have an own
Python API in each node doing the security and being a middleman between
the cluster and the webapp).

But how can I avoid 3rd-parties to just build a Riak server themselves and
join my cluster without permission... they can freely join like this:

# riak-admin join riak@111.222.333.1

Of course, they will have to find out the IP address, but if they do, they
can simply put a server themselves in the cluster and do whatever they want
with it.

Maybe a solution is creating subdomains on my domain just for the riak-ring
in a way that is extremely hard to find out to be able to do the JOIN,
something like: nodename = r...@rk001blahblahblah.mydomain.com

Is this approach reasonable? Am I doing/thinking something very wrong? What
would be the suggested way to prevent undesired JOINs?

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


Re: Cluster security

2014-06-30 Thread Alex De la rosa
Hi guys,

Thanks for the info about the "erlang cookie", will take a look at it :)

Yeah, of course that i will have firewalls and restrict access, that's also
why i will limit the querying to the localhost and have a middleman API to
talk to the node itself, just i was worried in the fact that somebody would
just find out an IP or domain and try to hook-up a node itself.

Cheers,
Alex


On Mon, Jun 30, 2014 at 12:08 PM, Sargun Dhillon  wrote:

> You really should have some level of IP filtering to prevent people
> from connecting directly to your BEAM / EPM instances, but even if
> they do have the ability to make a TCP/IP connection, they have to
> know the distributed Erlang cookie in order to connect. More on this:
> http://www.erlang.org/doc/reference_manual/distributed.html - See,
> section 13.7. You can actually use inet_tls for communication between
> your VMs to ensure authenticity of clients, as well as
> confidentiality.
>
> On Mon, Jun 30, 2014 at 2:47 AM, Alex De la rosa
>  wrote:
> > Hi there,
> >
> > Imaging the following IP configuration for Riak 2.0:
> >
> > # /etc/riak/riak.conf
> >
> > nodename = riak@111.222.333.1
> > listener.http.internal = 127.0.0.1:8098
> > listener.protobuf.internal = 127.0.0.1:8087
> > listener.https.internal = 127.0.0.1:8098
> >
> > I put the server's real IP in the nodename so they can join/communicate
> with
> > each other but then I limit any HTTP/PB communication to the localhost so
> > nobody can mess with the node from outside (we assume I have an own
> Python
> > API in each node doing the security and being a middleman between the
> > cluster and the webapp).
> >
> > But how can I avoid 3rd-parties to just build a Riak server themselves
> and
> > join my cluster without permission... they can freely join like this:
> >
> > # riak-admin join riak@111.222.333.1
> >
> > Of course, they will have to find out the IP address, but if they do,
> they
> > can simply put a server themselves in the cluster and do whatever they
> want
> > with it.
> >
> > Maybe a solution is creating subdomains on my domain just for the
> riak-ring
> > in a way that is extremely hard to find out to be able to do the JOIN,
> > something like: nodename = r...@rk001blahblahblah.mydomain.com
> >
> > Is this approach reasonable? Am I doing/thinking something very wrong?
> What
> > would be the suggested way to prevent undesired JOINs?
> >
> > Cheers,
> > Alex
> >
> > ___
> > 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: Riak for streaming video

2014-06-30 Thread Alex De la rosa
Hi Kota,

返事をありがとうございました! :)

Ok, understood, so 1 Stanchion server shouldn't be a problem at all, good
to know :)

Cheers,
Alex


On Mon, Jun 30, 2014 at 5:03 PM, Kota Uenishi  wrote:

> There are a lot of variety, in definition of being SPOF. It also
> depends on not only software implementation but also on setup
> configuration and operation.
>
> When it comes to Stanchion, it just serializes creation, modification
> and deletion of buckets and users, and all data is stored in Riak,
> which means, Stanchion failure does not cause any data loss but just
> downtime of these operations. As Brian points out that all other
> operations on objects will work fine.
>
> Even you can run two Act-Standby Stanchion processes at once. But the
> only thing operators should not do is, to let any two CS nodes see
> different Stanchion at once. After the operator make sure 'primary'
> Stanchion killed or stopped, it's okay to do any style of failover.
>
> On Mon, Jun 30, 2014 at 7:27 PM, Brian Akins  wrote:
> > Stanchion is only used for user modification and creating/deleting
> buckets.
> > The cluster will function just fine without it except for those
> functions.
> >
> >
> > On Jun 30, 2014, at 3:10 AM, Alex De la rosa 
> > wrote:
> >
> > Hi Jared,
> >
> > Thanks for your explanation and links... my next question is... Is
> Stanchion
> > not a single-point of failure? One of the things I like in Standard Riak
> is
> > that every node has the same level, there are no masters, no slaves... if
> > one fail it doesn't matter, the rest can do the job. If Riak CS requires
> un
> > especial node, what happens if that one fails? system is down then? Can
> you
> > configure the system with more than one Stanchion node?
> >
> > Cheers,
> > Alex
> >
> >
> > On Mon, Jun 30, 2014 at 7:37 AM, Jared Morrow  wrote:
> >>
> >> Alex,
> >>
> >> That is correct.  There are some additional docs we have on
> load-balancing
> >> and such on our docs page
> >>
> http://docs.basho.com/riakcs/latest/cookbooks/configuration/Load-Balancing-and-Proxy-Configuration/
> ,
> >> but generally it acts and feels like a Riak installation.  One
> additional
> >> special node is required (Stanchion) and that is also described on our
> docs
> >> page
> >>
> http://docs.basho.com/riakcs/latest/cookbooks/configuration/Configuring-Stanchion/
> .
> >>
> >> Keep the questions coming, if I don't know the details I'll hand off to
> >> Engineers more knowledgable with RiakCS.
> >>
> >> -Jared
> >>
> >>
> >>
> >>
> >> On Sun, Jun 29, 2014 at 5:58 AM, Alex De la rosa <
> alex.rosa@gmail.com>
> >> wrote:
> >>>
> >>> Hi there,
> >>>
> >>> One more question regarding Riak CS, does it behave like standard Riak?
> >>> storing 3 copies (default) and needing a minimum of 5 servers to
> operate?
> >>>
> >>> Cheers,
> >>> Alex
> >>>
> >>>
> >>> On Fri, Jun 27, 2014 at 2:43 AM, Jared Morrow  wrote:
> >>>>
> >>>> Luwak is definitely EOL'd and RiakCS is our large object store going
> >>>> forward.  It is a far superior design compared to Luwak and handles
> very
> >>>> large file sizes.
> >>>>
> >>>>
> >>>>
> >>>> On Thursday, June 26, 2014, Jason Campbell  wrote:
> >>>>>
> >>>>> Riak CS is designed to be the same interface as Amazon S3.  It can be
> >>>>> run anywhere you can run Riak.
> >>>>>
> >>>>> Think of it as a way to run your own S3.
> >>>>>
> >>>>> I think the hard limit on Riak objects is 50MB, but the recommended
> >>>>> size is less than 1MB per object.  The main reason for that is
> latency.
> >>>>> It's faster to get 100x1MB chunks from the entire cluster than it is
> to get
> >>>>> 1x100MB chunk from a single server.  It's also easier for disks to
> pull a
> >>>>> 1MB object without delaying any other requests than pulling a 100MB
> object,
> >>>>> which may end up queuing other requests made after.
> >>>>>
> >>>>> There used to be a project called luwak that was built into Riak and
> >>>>> handled chunking files like this, but it has been EOL'd.  Perhaps
> someone
&g

Re: Question about counters

2014-07-01 Thread Alex De la rosa
Hi there,

I found out why Riak was not starting when I enabled it... JAVA was not
installed!!... However, after installing Java and successfully started Riak
with search enabled, when trying to use "search" it crashes very badly,
this is the Java Version I have under Ubuntu Server 14.04 LTS:

java version "1.7.0_60"
Java(TM) SE Runtime Environment (build 1.7.0_60-b19)
Java HotSpot(TM) 64-Bit Server VM (build 24.60-b09, mixed mode)

This is my testing code using Python library:
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-

import riak
client = riak.RiakClient(protocol='pbc',
nodes=[{'host':'127.0.0.1','http_port':8098,'pb_port':8087}])
bucket = client.bucket('accounts')
bucket.enable_search()
key = bucket.new('alex', data={"username":"Alex","age":25,"sex":"male"},
content_type='application/json')
key.store()
print bucket.search('sex=male')

# Code following example in:
http://basho.github.io/riak-python-client/query.html#fulltext-search

-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
This is the error that Riak Search is giving to me:
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-

Traceback (most recent call last):
  File "test.py", line 7, in 
bucket.search('sex=male')
  File
"/usr/local/lib/python2.7/dist-packages/riak-2.0.3-py2.7.egg/riak/bucket.py",
line 446, in search
  File
"/usr/local/lib/python2.7/dist-packages/riak-2.0.3-py2.7.egg/riak/client/transport.py",
line 127, in wrapper
  File
"/usr/local/lib/python2.7/dist-packages/riak-2.0.3-py2.7.egg/riak/client/transport.py",
line 69, in _with_retries
  File
"/usr/local/lib/python2.7/dist-packages/riak-2.0.3-py2.7.egg/riak/client/transport.py",
line 125, in thunk
  File
"/usr/local/lib/python2.7/dist-packages/riak-2.0.3-py2.7.egg/riak/client/operations.py",
line 428, in fulltext_search
  File
"/usr/local/lib/python2.7/dist-packages/riak-2.0.3-py2.7.egg/riak/transports/pbc/transport.py",
line 453, in search
  File
"/usr/local/lib/python2.7/dist-packages/riak-2.0.3-py2.7.egg/riak/transports/pbc/connection.py",
line 43, in _request
  File
"/usr/local/lib/python2.7/dist-packages/riak-2.0.3-py2.7.egg/riak/transports/pbc/connection.py",
line 55, in _recv_msg
riak.RiakError: 'No index <<"accounts">> found.'
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-

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


Re: Question about counters

2014-07-01 Thread Alex De la rosa
I found out on http://docs.basho.com/riak/2.0.0beta1/dev/using/search that
in Riak 2.0 additional steps are needed... i fixed my code as follows, but
still crashing:

-+-+-+-+-+-+-+-+-+-+
-+-+-+-+-
import riak
client = riak.RiakClient(protocol='pbc',
nodes=[{'host':'127.0.0.1','http_port':8098,'pb_port':8087}])
client.create_search_index('men') # NEW: Creating a search index
bucket = client.bucket('accounts')
bucket.enable_search()
bucket.set_property('search_index', 'men') # NEW: Setting the search index
to the bucket
key = bucket.new('alex', data={"username":"Alex","age":25,"sex":"male"},
content_type='application/json')
key.store()
print bucket.search('sex=male')
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-

this time seems the Python client is not fully updated again and missing
functionality (like "counters"):

-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
Traceback (most recent call last):
  File "test.py", line 3, in 
client.create_search_index('men')
AttributeError: 'RiakClient' object has no attribute 'create_search_index'
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-

Is a problem of the Python client? Or there is something wrong on my code?
When will it be a Python client update solving all these issues? is a bit
frustrating wanting to try the features and see you can not do it because
the client is not fully operational.

Cheers,
Alex

On Tue, Jul 1, 2014 at 10:38 AM, Alex De la rosa 
wrote:

> Hi there,
>
> I found out why Riak was not starting when I enabled it... JAVA was not
> installed!!... However, after installing Java and successfully started Riak
> with search enabled, when trying to use "search" it crashes very badly,
> this is the Java Version I have under Ubuntu Server 14.04 LTS:
>
> java version "1.7.0_60"
> Java(TM) SE Runtime Environment (build 1.7.0_60-b19)
> Java HotSpot(TM) 64-Bit Server VM (build 24.60-b09, mixed mode)
>
> This is my testing code using Python library:
>
> -+-+-+-+-+-+-+-+-+-+-+-+-+-+-
>
> import riak
> client = riak.RiakClient(protocol='pbc',
> nodes=[{'host':'127.0.0.1','http_port':8098,'pb_port':8087}])
> bucket = client.bucket('accounts')
> bucket.enable_search()
> key = bucket.new('alex', data={"username":"Alex","age":25,"sex":"male"},
> content_type='application/json')
> key.store()
> print bucket.search('sex=male')
>
> # Code following example in:
> http://basho.github.io/riak-python-client/query.html#fulltext-search
>
>
> -+-+-+-+-+-+-+-+-+-+-+-+-+-+-
> This is the error that Riak Search is giving to me:
>
> -+-+-+-+-+-+-+-+-+-+-+-+-+-+-
>
> Traceback (most recent call last):
>   File "test.py", line 7, in 
> bucket.search('sex=male')
>   File
> "/usr/local/lib/python2.7/dist-packages/riak-2.0.3-py2.7.egg/riak/bucket.py",
> line 446, in search
>   File
> "/usr/local/lib/python2.7/dist-packages/riak-2.0.3-py2.7.egg/riak/client/transport.py",
> line 127, in wrapper
>   File
> "/usr/local/lib/python2.7/dist-packages/riak-2.0.3-py2.7.egg/riak/client/transport.py",
> line 69, in _with_retries
>   File
> "/usr/local/lib/python2.7/dist-packages/riak-2.0.3-py2.7.egg/riak/client/transport.py",
> line 125, in thunk
>   File
> "/usr/local/lib/python2.7/dist-packages/riak-2.0.3-py2.7.egg/riak/client/operations.py",
> line 428, in fulltext_search
>   File
> "/usr/local/lib/python2.7/dist-packages/riak-2.0.3-py2.7.egg/riak/transports/pbc/transport.py",
> line 453, in search
>   File
> "/usr/local/lib/python2.7/dist-packages/riak-2.0.3-py2.7.egg/riak/transports/pbc/connection.py",
> line 43, in _request
>   File
> "/usr/local/lib/python2.7/dist-packages/riak-2.0.3-py2.7.egg/riak/transports/pbc/connection.py",
> line 55, in _recv_msg
> riak.RiakError: 'No index <<"accounts">> found.'
>
> -+-+-+-+-+-+-+-+-+-+-+-+-+-+-
>
> Cheers,
> Alex
>
___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


Re: Question about counters

2014-07-01 Thread Alex De la rosa
I actually have the latest version available (2.0.3), I got it like this:

easy_install
https://pypi.python.org/packages/2.7/r/riak/riak-2.0.3-py2.7.egg

If I clone the GIT repository, may I have problems as I have the
easy_install package already? would it conflict somehow?

Cheers,
Alex


On Tue, Jul 1, 2014 at 3:23 PM, Luke Bakken  wrote:

> Hi Alex,
>
> Search in Riak 2.0 does require a JVM to be installed as you found.
>
> create_search_index is part of the master branch of the Python client:
>
> lbakken ~/Projects/basho/riak-python-client (master=)
> $ git grep create_search_index
> riak/client/operations.py:461:def create_search_index(self, transport,
> index, schema=None, n_val=None):
>
> Could you make a clone of the git repository and use the code from there?
>
> https://github.com/basho/riak-python-client
>
> --
> Luke Bakken
> CSE
> lbak...@basho.com
>
>
> On Tue, Jul 1, 2014 at 2:10 AM, Alex De la rosa 
> wrote:
>
>> I found out on http://docs.basho.com/riak/2.0.0beta1/dev/using/search
>> that in Riak 2.0 additional steps are needed... i fixed my code as follows,
>> but still crashing:
>>
>> -+-+-+-+-+-+-+-+-+-+
>> -+-+-+-+-
>> import riak
>> client = riak.RiakClient(protocol='pbc',
>> nodes=[{'host':'127.0.0.1','http_port':8098,'pb_port':8087}])
>> client.create_search_index('men') # NEW: Creating a search index
>> bucket = client.bucket('accounts')
>> bucket.enable_search()
>> bucket.set_property('search_index', 'men') # NEW: Setting the search
>> index to the bucket
>> key = bucket.new('alex', data={"username":"Alex","age":25,"sex":"male"},
>> content_type='application/json')
>> key.store()
>> print bucket.search('sex=male')
>>
>> -+-+-+-+-+-+-+-+-+-+-+-+-+-+-
>>
>> this time seems the Python client is not fully updated again and missing
>> functionality (like "counters"):
>>
>>
>> -+-+-+-+-+-+-+-+-+-+-+-+-+-+-
>> Traceback (most recent call last):
>>   File "test.py", line 3, in 
>> client.create_search_index('men')
>> AttributeError: 'RiakClient' object has no attribute 'create_search_index'
>>
>> -+-+-+-+-+-+-+-+-+-+-+-+-+-+-
>>
>> Is a problem of the Python client? Or there is something wrong on my
>> code? When will it be a Python client update solving all these issues? is a
>> bit frustrating wanting to try the features and see you can not do it
>> because the client is not fully operational.
>>
>> Cheers,
>> Alex
>>
>
___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


Re: Question about counters

2014-07-01 Thread Alex De la rosa
Ok... now is worse... i removed my old Python client EGG and cloned the GIT
repository, and after install it, I get the following error:

Traceback (most recent call last):
  File "test.py", line 13, in 
import riak
  File "build/bdist.linux-x86_64/egg/riak/__init__.py", line 59, in 
  File "build/bdist.linux-x86_64/egg/riak/client/__init__.py", line 29, in

  File "build/bdist.linux-x86_64/egg/riak/client/operations.py", line 19,
in 
  File "build/bdist.linux-x86_64/egg/riak/client/transport.py", line 20, in

  File "build/bdist.linux-x86_64/egg/riak/transports/pbc/__init__.py", line
25, in 
  File "build/bdist.linux-x86_64/egg/riak/transports/pbc/transport.py",
line 27, in 
  File "build/bdist.linux-x86_64/egg/riak/transports/pbc/connection.py",
line 22, in 
  File "build/bdist.linux-x86_64/egg/riak/security.py", line 19, in 
  File "build/bdist.linux-x86_64/egg/OpenSSL/__init__.py", line 8, in

  File "build/bdist.linux-x86_64/egg/OpenSSL/rand.py", line 11, in 
  File "build/bdist.linux-x86_64/egg/OpenSSL/_util.py", line 3, in 
ImportError: No module named cryptography.hazmat.bindings.openssl.binding

Cheers,
Alex


On Tue, Jul 1, 2014 at 3:32 PM, Alex De la rosa 
wrote:

> I actually have the latest version available (2.0.3), I got it like this:
>
> easy_install
> https://pypi.python.org/packages/2.7/r/riak/riak-2.0.3-py2.7.egg
>
> If I clone the GIT repository, may I have problems as I have the
> easy_install package already? would it conflict somehow?
>
> Cheers,
> Alex
>
>
> On Tue, Jul 1, 2014 at 3:23 PM, Luke Bakken  wrote:
>
>> Hi Alex,
>>
>> Search in Riak 2.0 does require a JVM to be installed as you found.
>>
>> create_search_index is part of the master branch of the Python client:
>>
>> lbakken ~/Projects/basho/riak-python-client (master=)
>> $ git grep create_search_index
>> riak/client/operations.py:461:def create_search_index(self,
>> transport, index, schema=None, n_val=None):
>>
>> Could you make a clone of the git repository and use the code from there?
>>
>> https://github.com/basho/riak-python-client
>>
>> --
>> Luke Bakken
>> CSE
>> lbak...@basho.com
>>
>>
>> On Tue, Jul 1, 2014 at 2:10 AM, Alex De la rosa 
>> wrote:
>>
>>> I found out on http://docs.basho.com/riak/2.0.0beta1/dev/using/search
>>> that in Riak 2.0 additional steps are needed... i fixed my code as follows,
>>> but still crashing:
>>>
>>> -+-+-+-+-+-+-+-+-+-+
>>> -+-+-+-+-
>>> import riak
>>> client = riak.RiakClient(protocol='pbc',
>>> nodes=[{'host':'127.0.0.1','http_port':8098,'pb_port':8087}])
>>> client.create_search_index('men') # NEW: Creating a search index
>>> bucket = client.bucket('accounts')
>>> bucket.enable_search()
>>> bucket.set_property('search_index', 'men') # NEW: Setting the search
>>> index to the bucket
>>> key = bucket.new('alex', data={"username":"Alex","age":25,"sex":"male"},
>>> content_type='application/json')
>>> key.store()
>>> print bucket.search('sex=male')
>>>
>>> -+-+-+-+-+-+-+-+-+-+-+-+-+-+-
>>>
>>> this time seems the Python client is not fully updated again and missing
>>> functionality (like "counters"):
>>>
>>>
>>> -+-+-+-+-+-+-+-+-+-+-+-+-+-+-
>>> Traceback (most recent call last):
>>>   File "test.py", line 3, in 
>>> client.create_search_index('men')
>>> AttributeError: 'RiakClient' object has no attribute
>>> 'create_search_index'
>>>
>>> -+-+-+-+-+-+-+-+-+-+-+-+-+-+-
>>>
>>> Is a problem of the Python client? Or there is something wrong on my
>>> code? When will it be a Python client update solving all these issues? is a
>>> bit frustrating wanting to try the features and see you can not do it
>>> because the client is not fully operational.
>>>
>>> Cheers,
>>> Alex
>>>
>>
>
___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


Re: Question about counters

2014-07-01 Thread Alex De la rosa
Uhm... I'm new to Python so that sounds like Chinese to me... I will have
to look online how to do all that, see if I can fix it.

Cheers,
Alex


On Tue, Jul 1, 2014 at 3:50 PM, Luke Bakken  wrote:

> Alex,
>
> I did a Google search on the following string:
>
> "ImportError: No module named cryptography.hazmat.bindings.openssl.binding"
>
> Your python2-pyopenssl module may be out of date. I would recommend
> first uninstalling the Python Riak client from your global Python
> libraries. Then, use virtualenv to create a testing environment so you
> can work through these issues. Once you have everything working via
> your virtualenv-environment, update your global environment.
>
> --
> Luke Bakken
> CSE
> lbak...@basho.com
>
>
> On Tue, Jul 1, 2014 at 6:40 AM, Alex De la rosa 
> wrote:
> >
> > Ok... now is worse... i removed my old Python client EGG and cloned the
> GIT repository, and after install it, I get the following error:
> >
> >
> > Traceback (most recent call last):
> >   File "test.py", line 13, in 
> > import riak
> >   File "build/bdist.linux-x86_64/egg/riak/__init__.py", line 59, in
> 
> >   File "build/bdist.linux-x86_64/egg/riak/client/__init__.py", line 29,
> in 
> >   File "build/bdist.linux-x86_64/egg/riak/client/operations.py", line
> 19, in 
> >   File "build/bdist.linux-x86_64/egg/riak/client/transport.py", line 20,
> in 
> >   File "build/bdist.linux-x86_64/egg/riak/transports/pbc/__init__.py",
> line 25, in 
> >   File "build/bdist.linux-x86_64/egg/riak/transports/pbc/transport.py",
> line 27, in 
> >   File "build/bdist.linux-x86_64/egg/riak/transports/pbc/connection.py",
> line 22, in 
> >   File "build/bdist.linux-x86_64/egg/riak/security.py", line 19, in
> 
> >   File "build/bdist.linux-x86_64/egg/OpenSSL/__init__.py", line 8, in
> 
> >   File "build/bdist.linux-x86_64/egg/OpenSSL/rand.py", line 11, in
> 
> >   File "build/bdist.linux-x86_64/egg/OpenSSL/_util.py", line 3, in
> 
> > ImportError: No module named cryptography.hazmat.bindings.openssl.binding
> >
> > Cheers,
> > Alex
> >
> >
> > On Tue, Jul 1, 2014 at 3:32 PM, Alex De la rosa 
> wrote:
> >>
> >> I actually have the latest version available (2.0.3), I got it like
> this:
> >>
> >> easy_install
> https://pypi.python.org/packages/2.7/r/riak/riak-2.0.3-py2.7.egg
> >>
> >> If I clone the GIT repository, may I have problems as I have the
> easy_install package already? would it conflict somehow?
> >>
> >> Cheers,
> >> Alex
> >>
> >>
> >>
> >> On Tue, Jul 1, 2014 at 3:23 PM, Luke Bakken  wrote:
> >>>
> >>> Hi Alex,
> >>>
> >>> Search in Riak 2.0 does require a JVM to be installed as you found.
> >>>
> >>> create_search_index is part of the master branch of the Python client:
> >>>
> >>> lbakken ~/Projects/basho/riak-python-client (master=)
> >>> $ git grep create_search_index
> >>> riak/client/operations.py:461:def create_search_index(self,
> transport, index, schema=None, n_val=None):
> >>>
> >>> Could you make a clone of the git repository and use the code from
> there?
> >>>
> >>> https://github.com/basho/riak-python-client
> >>>
> >>> --
> >>> Luke Bakken
> >>> CSE
> >>> lbak...@basho.com
> >>>
> >>>
> >>> On Tue, Jul 1, 2014 at 2:10 AM, Alex De la rosa <
> alex.rosa@gmail.com> wrote:
> >>>>
> >>>> I found out on http://docs.basho.com/riak/2.0.0beta1/dev/using/search
> that in Riak 2.0 additional steps are needed... i fixed my code as follows,
> but still crashing:
> >>>>
> >>>>
> -+-+-+-+-+-+-+-+-+-+-+-+-+-+-
> >>>> import riak
> >>>> client = riak.RiakClient(protocol='pbc',
> nodes=[{'host':'127.0.0.1','http_port':8098,'pb_port':8087}])
> >>>> client.create_search_index('men') # NEW: Creating a search index
> >>>> bucket = client.bucket('accounts')
> >>>> bucket.enable_search()
> >>>> bucket.set_property('search_index', 'men') # NEW: Setting the search
> index to the bucket
> >>>> key = bucket.new(

Re: Question about counters

2014-07-01 Thread Alex De la rosa
Hi Sean,

I indeed installed the GIT client with "python setup.py install" and then
is when this error happened.

Cheers,
Alex


On Tue, Jul 1, 2014 at 4:03 PM, Sean Cribbs  wrote:

> Alex,
>
> As I might have mentioned before, the Python client is in a bit of flux
> right now as we try to complete support for the Riak 2.0 features. In order
> to support Riak 2.0's security capabilities, we have had to pull in
> pyOpenSSL as a dependency (which has its own dependencies as well), which
> explains the error you got. From within your git checkout, run this:
>
> ./setup.py install
>
> That should ensure that all the proper dependencies are installed.
>
>
> On Tue, Jul 1, 2014 at 8:52 AM, Alex De la rosa 
> wrote:
>
>> Uhm... I'm new to Python so that sounds like Chinese to me... I will have
>> to look online how to do all that, see if I can fix it.
>>
>> Cheers,
>> Alex
>>
>>
>> On Tue, Jul 1, 2014 at 3:50 PM, Luke Bakken  wrote:
>>
>>> Alex,
>>>
>>> I did a Google search on the following string:
>>>
>>> "ImportError: No module named
>>> cryptography.hazmat.bindings.openssl.binding"
>>>
>>> Your python2-pyopenssl module may be out of date. I would recommend
>>> first uninstalling the Python Riak client from your global Python
>>> libraries. Then, use virtualenv to create a testing environment so you
>>> can work through these issues. Once you have everything working via
>>> your virtualenv-environment, update your global environment.
>>>
>>> --
>>> Luke Bakken
>>> CSE
>>> lbak...@basho.com
>>>
>>>
>>> On Tue, Jul 1, 2014 at 6:40 AM, Alex De la rosa 
>>> wrote:
>>> >
>>> > Ok... now is worse... i removed my old Python client EGG and cloned
>>> the GIT repository, and after install it, I get the following error:
>>> >
>>> >
>>> > Traceback (most recent call last):
>>> >   File "test.py", line 13, in 
>>> > import riak
>>> >   File "build/bdist.linux-x86_64/egg/riak/__init__.py", line 59, in
>>> 
>>> >   File "build/bdist.linux-x86_64/egg/riak/client/__init__.py", line
>>> 29, in 
>>> >   File "build/bdist.linux-x86_64/egg/riak/client/operations.py", line
>>> 19, in 
>>> >   File "build/bdist.linux-x86_64/egg/riak/client/transport.py", line
>>> 20, in 
>>> >   File "build/bdist.linux-x86_64/egg/riak/transports/pbc/__init__.py",
>>> line 25, in 
>>> >   File
>>> "build/bdist.linux-x86_64/egg/riak/transports/pbc/transport.py", line 27,
>>> in 
>>> >   File
>>> "build/bdist.linux-x86_64/egg/riak/transports/pbc/connection.py", line 22,
>>> in 
>>> >   File "build/bdist.linux-x86_64/egg/riak/security.py", line 19, in
>>> 
>>> >   File "build/bdist.linux-x86_64/egg/OpenSSL/__init__.py", line 8, in
>>> 
>>> >   File "build/bdist.linux-x86_64/egg/OpenSSL/rand.py", line 11, in
>>> 
>>> >   File "build/bdist.linux-x86_64/egg/OpenSSL/_util.py", line 3, in
>>> 
>>> > ImportError: No module named
>>> cryptography.hazmat.bindings.openssl.binding
>>> >
>>> > Cheers,
>>> > Alex
>>> >
>>> >
>>> > On Tue, Jul 1, 2014 at 3:32 PM, Alex De la rosa <
>>> alex.rosa@gmail.com> wrote:
>>> >>
>>> >> I actually have the latest version available (2.0.3), I got it like
>>> this:
>>> >>
>>> >> easy_install
>>> https://pypi.python.org/packages/2.7/r/riak/riak-2.0.3-py2.7.egg
>>> >>
>>> >> If I clone the GIT repository, may I have problems as I have the
>>> easy_install package already? would it conflict somehow?
>>> >>
>>> >> Cheers,
>>> >> Alex
>>> >>
>>> >>
>>> >>
>>> >> On Tue, Jul 1, 2014 at 3:23 PM, Luke Bakken 
>>> wrote:
>>> >>>
>>> >>> Hi Alex,
>>> >>>
>>> >>> Search in Riak 2.0 does require a JVM to be installed as you found.
>>> >>>
>>> >>> create_search_index is part of the master branch of the Python
>>> client:
>>> >>>
>>> >>> lbakken ~/Projects/basho/riak-python-clien

Re: Question about counters

2014-07-01 Thread Alex De la rosa
Is ok, I will manage to fix it, if not I will just remake my VM.

Cheers,
Alex

On Tuesday, July 1, 2014, Sean Cribbs  wrote:

> Sorry, I don't know how to fix that then. I don't know whether an updated
> package for any of those is available via Ubuntu or PPA, because I've
> always installed Python dependencies via pip or easy_install. In general, I
> would distrust the distribution version because they tend to be out-of-date.
>
>
> On Tue, Jul 1, 2014 at 9:07 AM, Alex De la rosa  > wrote:
>
>> Hi Sean,
>>
>> I indeed installed the GIT client with "python setup.py install" and then
>> is when this error happened.
>>
>> Cheers,
>> Alex
>>
>>
>> On Tue, Jul 1, 2014 at 4:03 PM, Sean Cribbs > > wrote:
>>
>>> Alex,
>>>
>>> As I might have mentioned before, the Python client is in a bit of flux
>>> right now as we try to complete support for the Riak 2.0 features. In order
>>> to support Riak 2.0's security capabilities, we have had to pull in
>>> pyOpenSSL as a dependency (which has its own dependencies as well), which
>>> explains the error you got. From within your git checkout, run this:
>>>
>>> ./setup.py install
>>>
>>> That should ensure that all the proper dependencies are installed.
>>>
>>>
>>> On Tue, Jul 1, 2014 at 8:52 AM, Alex De la rosa >> > wrote:
>>>
>>>> Uhm... I'm new to Python so that sounds like Chinese to me... I will
>>>> have to look online how to do all that, see if I can fix it.
>>>>
>>>> Cheers,
>>>> Alex
>>>>
>>>>
>>>> On Tue, Jul 1, 2014 at 3:50 PM, Luke Bakken >>> > wrote:
>>>>
>>>>> Alex,
>>>>>
>>>>> I did a Google search on the following string:
>>>>>
>>>>> "ImportError: No module named
>>>>> cryptography.hazmat.bindings.openssl.binding"
>>>>>
>>>>> Your python2-pyopenssl module may be out of date. I would recommend
>>>>> first uninstalling the Python Riak client from your global Python
>>>>> libraries. Then, use virtualenv to create a testing environment so you
>>>>> can work through these issues. Once you have everything working via
>>>>> your virtualenv-environment, update your global environment.
>>>>>
>>>>> --
>>>>> Luke Bakken
>>>>> CSE
>>>>> lbak...@basho.com 
>>>>>
>>>>>
>>>>> On Tue, Jul 1, 2014 at 6:40 AM, Alex De la rosa <
>>>>> alex.rosa@gmail.com
>>>>> > wrote:
>>>>> >
>>>>> > Ok... now is worse... i removed my old Python client EGG and cloned
>>>>> the GIT repository, and after install it, I get the following error:
>>>>> >
>>>>> >
>>>>> > Traceback (most recent call last):
>>>>> >   File "test.py", line 13, in 
>>>>> > import riak
>>>>> >   File "build/bdist.linux-x86_64/egg/riak/__init__.py", line 59, in
>>>>> 
>>>>> >   File "build/bdist.linux-x86_64/egg/riak/client/__init__.py", line
>>>>> 29, in 
>>>>> >   File "build/bdist.linux-x86_64/egg/riak/client/operations.py",
>>>>> line 19, in 
>>>>> >   File "build/bdist.linux-x86_64/egg/riak/client/transport.py", line
>>>>> 20, in 
>>>>> >   File
>>>>> "build/bdist.linux-x86_64/egg/riak/transports/pbc/__init__.py", line 25, 
>>>>> in
>>>>> 
>>>>> >   File
>>>>> "build/bdist.linux-x86_64/egg/riak/transports/pbc/transport.py", line 27,
>>>>> in 
>>>>> >   File
>>>>> "build/bdist.linux-x86_64/egg/riak/transports/pbc/connection.py", line 22,
>>>>> in 
>>>>> >   File "build/bdist.linux-x86_64/egg/riak/security.py", line 19, in
>>>>> 
>>>>> >   File "build/bdist.linux-x86_64/egg/OpenSSL/__init__.py", line 8,
>>>>> in 
>>>>> >   File "build/bdist.linux-x86_64/egg/OpenSSL/rand.py", line 11, in
>>>>> 
>>>>> >   File "build/bdist.linux-x86_64/egg/OpenSSL/_util.py", line 3, in
>>>>> 

Re: Riak 2.0.0 RC1

2014-07-21 Thread Alex De la rosa
Awesome! Can't wait to try it! What about the python client for Riak 2.0? I
remember testing the actual version and still have many issues and
non-workable new features (like counters, sets, maps, etc.)

Thanks!
Alex


On Mon, Jul 21, 2014 at 11:34 PM, Jared Morrow  wrote:

> Riak-Users,
>
> Everyone at Basho is extremely happy to announce the public availability
> of Riak 2.0.0 RC. As a release candidate, we do not recommend using it in
> production, but it should be considered feature and API complete for Riak
> 2.0 final. We reserve the right to make changes for any data-loss or severe
> performance issues found post-RC, but these will not affect the API.
>
> This is our most ambitious release, with major new features throughout the
> product. With that in mind, please take plenty of time to read through the
> Release Notes. There are some important considerations regarding upgrades,
> known issues, and packaging. The Release Notes are still a work-in-progress
> and will be continually updated as we march towards 2.0 final. We have made
> a lot of progress on our docs site  for 2.0, but
> still have work to do before final release. We appreciate your patience.
>
>-
>
>*Release Notes*:
>https://github.com/basho/riak/blob/2.0/RELEASE-NOTES.md
> -
>
>*Downloads*: http://docs.basho.com/riak/2.0.0/downloads/
>Note: There will be minor tweaks to the download site to show the
>labels for SuSE Enterprise Linux and Ubuntu 14.04 packages
> -
>
>*APT/YUM Repos* (see release-notes re: this change):
>https://packagecloud.io/basho/riak/install Note: If you are
>downloading the files directly, use our docs site. For apt/yum repo
>install, use packagecloud.
>
> Thanks to everyone in our community,
> -Team Basho
> ​
>
> ___
> 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: Riak 2.0.0 RC1

2014-07-21 Thread Alex De la rosa
Cool! thanks, can't wait to have the updated Python library running :) we
have a new project incoming at work and would be awesome to be able to
start development with 2.0 and the Python client.

Thanks,
Alex


On Mon, Jul 21, 2014 at 11:58 PM, Jared Morrow  wrote:

> The clients are still being finalized.  Word on the street is the Java
> client RC will be very soon, and the other clients will follow.  The person
> who would know best has today off, but stay tuned.
>
> Thanks,
> Jared
>
>
> On Mon, Jul 21, 2014 at 3:38 PM, Alex De la rosa 
> wrote:
>
>> Awesome! Can't wait to try it! What about the python client for Riak 2.0?
>> I remember testing the actual version and still have many issues and
>> non-workable new features (like counters, sets, maps, etc.)
>>
>> Thanks!
>> Alex
>>
>>
>> On Mon, Jul 21, 2014 at 11:34 PM, Jared Morrow  wrote:
>>
>>>  Riak-Users,
>>>
>>> Everyone at Basho is extremely happy to announce the public availability
>>> of Riak 2.0.0 RC. As a release candidate, we do not recommend using it in
>>> production, but it should be considered feature and API complete for Riak
>>> 2.0 final. We reserve the right to make changes for any data-loss or severe
>>> performance issues found post-RC, but these will not affect the API.
>>>
>>> This is our most ambitious release, with major new features throughout
>>> the product. With that in mind, please take plenty of time to read through
>>> the Release Notes. There are some important considerations regarding
>>> upgrades, known issues, and packaging. The Release Notes are still a
>>> work-in-progress and will be continually updated as we march towards 2.0
>>> final. We have made a lot of progress on our docs site
>>> <http://docs.basho.com> for 2.0, but still have work to do before final
>>> release. We appreciate your patience.
>>>
>>>-
>>>
>>>*Release Notes*:
>>>https://github.com/basho/riak/blob/2.0/RELEASE-NOTES.md
>>> -
>>>
>>>*Downloads*: http://docs.basho.com/riak/2.0.0/downloads/
>>>Note: There will be minor tweaks to the download site to show the
>>>labels for SuSE Enterprise Linux and Ubuntu 14.04 packages
>>> -
>>>
>>>*APT/YUM Repos* (see release-notes re: this change):
>>>https://packagecloud.io/basho/riak/install Note: If you are
>>>downloading the files directly, use our docs site. For apt/yum repo
>>>install, use packagecloud.
>>>
>>> Thanks to everyone in our community,
>>> -Team Basho
>>> ​
>>>
>>> ___
>>> 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


Python Client for 2.0rc1

2014-07-28 Thread Alex De la rosa
Hi there,

Is there any estimate time for the Python Client to be released so we can
use Counters, Sets, Maps, etc... properly?

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


Re: Python Client for 2.0rc1

2014-07-28 Thread Alex De la rosa
Hi Sean,

Cool! good to know it seems is going to be something out there soon :)

Thanks!
Alex


On Mon, Jul 28, 2014 at 5:47 PM, Sean Cribbs  wrote:

> Hi Alex,
>
> We're trying to finish up one or two more issues, then we'll release a
> preview to PyPi. Hang in there.
>
>
> On Mon, Jul 28, 2014 at 10:31 AM, Alex De la rosa  > wrote:
>
>> Hi there,
>>
>> Is there any estimate time for the Python Client to be released so we can
>> use Counters, Sets, Maps, etc... properly?
>>
>> Thanks!
>> Alex
>>
>> ___
>> riak-users mailing list
>> riak-users@lists.basho.com
>> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>>
>>
>
>
> --
> Sean Cribbs 
> Software Engineer
> Basho Technologies, Inc.
> http://basho.com/
>
___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


Re: Riak Python Client release candidate published

2014-07-30 Thread Alex De la rosa
Awesome!! Can't wait to get my hands on it and Riak 2.0rc1! :)

Thanks!
Alex

On Wednesday, July 30, 2014, Sean Cribbs  wrote:

> Hey Riak Users,
>
> We've just pushed a release candidate of the official Python client to
> PyPi [1]. This package includes support for Riak 2.0.0 RC1 features,
> including security, data types, Search 2.0 (Yokozuna), and bucket
> types. Documentation on the new APIs is incomplete [2], but you can
> refer to the official Riak documentation [3] for overviews and
> tutorials with Python-specific examples. We will be polishing the API
> documentation for the final release.
>
> Please note that this release adds a new dependency on pyOpenSSL [4],
> which supports a wider range of TLS options than the standard library
> ssl package. This is only used if you enable Riak 2.0's new security
> features, but will be installed regardless when you install the
> client. You may receive a warning when importing the client code if
> your version of OpenSSL is too old or doesn't expose TLS v1.2.
>
> Significant changes that are not related to new Riak features:
>
> - Previously-marked deprecated methods/features have been removed. [5]
> - PB is now the default protocol for new clients. [6] HTTP is still
>   available, but this is part of our larger effort to phase out HTTP
>   in our official libraries.
>
> There are some significant known-issues with this package that you
> should be aware of:
>
> - Strongly-consistent keys will work (the API is similar enough to
>   regular K/V), but if a CAS update operation fails, your application
>   code will have to perform the retry. This will be wrapped in an API
>   for the final release.
> - We have had multiple reports of connections leaking while iterating
>   over streamed responses [7], these will be resolved by final
>   release.
> - Although the behavior hasn't changed, we will be attempting to
>   address a number of Unicode issues before final release [8].
>
> For all other known issues, please refer to the issue tracker on
> Github [9]. Milestones in the tracker refer to *Riak* releases
> although the client version is different. We encourage you to report
> any issues you find with the release candidate client.
>
> Cheers!
>
> [1] https://pypi.python.org/pypi/riak/2.1.0rc1
> [2] http://riak-python-client.readthedocs.org/en/master/
> [3] http://docs.basho.com/riak/2.0.0/dev/using/search/
> http://docs.basho.com/riak/2.0.0/dev/advanced/bucket-types/
> http://docs.basho.com/riak/2.0.0/dev/using/data-types/
> http://docs.basho.com/riak/2.0.0/dev/data-modeling/data-types/
> http://docs.basho.com/riak/2.0.0/ops/running/authz/
> http://docs.basho.com/riak/2.0.0/dev/advanced/strong-consistency/
> [4] https://pypi.python.org/pypi/pyOpenSSL/0.14
> [5] https://github.com/basho/riak-python-client/pull/328
> [6] https://github.com/basho/riak-python-client/pull/341
> [7] https://github.com/basho/riak-python-client/issues/318
> https://github.com/basho/riak-python-client/issues/312
> [8] https://github.com/basho/riak-python-client/issues/334
> [9] https://github.com/basho/riak-python-client/issues
>
> --
> Sean Cribbs >
> Software Engineer
> Basho Technologies, Inc.
> http://basho.com/
>
> ___
> 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


Python client error

2014-08-15 Thread Alex De la rosa
Hi there,

I installed riak-2.0rc1 and the Python client through "easy_intall riak",
however, when importing the "riak" library I got the following error:

Traceback (most recent call last):
  File "x.py", line 1, in 
import riak
  File
"/usr/local/lib/python2.7/dist-packages/riak-2.1.0rc1-py2.7.egg/riak/__init__.py",
line 59, in 
  File
"/usr/local/lib/python2.7/dist-packages/riak-2.1.0rc1-py2.7.egg/riak/client/__init__.py",
line 29, in 
  File
"/usr/local/lib/python2.7/dist-packages/riak-2.1.0rc1-py2.7.egg/riak/client/operations.py",
line 19, in 
  File
"/usr/local/lib/python2.7/dist-packages/riak-2.1.0rc1-py2.7.egg/riak/client/transport.py",
line 20, in 
  File
"/usr/local/lib/python2.7/dist-packages/riak-2.1.0rc1-py2.7.egg/riak/transports/pbc/__init__.py",
line 25, in 
  File
"/usr/local/lib/python2.7/dist-packages/riak-2.1.0rc1-py2.7.egg/riak/transports/pbc/transport.py",
line 27, in 
  File
"/usr/local/lib/python2.7/dist-packages/riak-2.1.0rc1-py2.7.egg/riak/transports/pbc/connection.py",
line 22, in 
  File
"/usr/local/lib/python2.7/dist-packages/riak-2.1.0rc1-py2.7.egg/riak/security.py",
line 19, in 
  File "build/bdist.linux-x86_64/egg/OpenSSL/__init__.py", line 8, in

  File "build/bdist.linux-x86_64/egg/OpenSSL/rand.py", line 11, in 
  File "build/bdist.linux-x86_64/egg/OpenSSL/_util.py", line 3, in 
ImportError: No module named cryptography.hazmat.bindings.openssl.binding

I'm using "Python 2.7.6", any clues on how to fix this?

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


package-cloud update issue

2014-08-15 Thread Alex De la rosa
Hi there,

I installed RIAK using the packagecloud.io repository [
https://packagecloud.io/basho/riak/install ], however, every time that I do
an "aptitude update" I receive that RIAK has a new version although is not
true:

aptitude safe-upgrade
The following packages will be upgraded:
  riak
1 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/55.0 MB of archives. After unpacking 0 B will be used.
Do you want to continue? [Y/n/?] n
Abort.

Just FYI, not a big deal, but I believe the repository shouldn't give you
an update when there is no update.

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


Re: Python client error

2014-08-15 Thread Alex De la rosa
Fixed, instead of using "easy_install riak" I used "pip install riak" and
it worked like a charm :)

Thanks!
Alex


On Fri, Aug 15, 2014 at 5:29 PM, Alex De la rosa 
wrote:

> Hi there,
>
> I installed riak-2.0rc1 and the Python client through "easy_intall riak",
> however, when importing the "riak" library I got the following error:
>
> Traceback (most recent call last):
>   File "x.py", line 1, in 
> import riak
>   File
> "/usr/local/lib/python2.7/dist-packages/riak-2.1.0rc1-py2.7.egg/riak/__init__.py",
> line 59, in 
>   File
> "/usr/local/lib/python2.7/dist-packages/riak-2.1.0rc1-py2.7.egg/riak/client/__init__.py",
> line 29, in 
>   File
> "/usr/local/lib/python2.7/dist-packages/riak-2.1.0rc1-py2.7.egg/riak/client/operations.py",
> line 19, in 
>   File
> "/usr/local/lib/python2.7/dist-packages/riak-2.1.0rc1-py2.7.egg/riak/client/transport.py",
> line 20, in 
>   File
> "/usr/local/lib/python2.7/dist-packages/riak-2.1.0rc1-py2.7.egg/riak/transports/pbc/__init__.py",
> line 25, in 
>   File
> "/usr/local/lib/python2.7/dist-packages/riak-2.1.0rc1-py2.7.egg/riak/transports/pbc/transport.py",
> line 27, in 
>   File
> "/usr/local/lib/python2.7/dist-packages/riak-2.1.0rc1-py2.7.egg/riak/transports/pbc/connection.py",
> line 22, in 
>   File
> "/usr/local/lib/python2.7/dist-packages/riak-2.1.0rc1-py2.7.egg/riak/security.py",
> line 19, in 
>   File "build/bdist.linux-x86_64/egg/OpenSSL/__init__.py", line 8, in
> 
>   File "build/bdist.linux-x86_64/egg/OpenSSL/rand.py", line 11, in 
>   File "build/bdist.linux-x86_64/egg/OpenSSL/_util.py", line 3, in 
> ImportError: No module named cryptography.hazmat.bindings.openssl.binding
>
> I'm using "Python 2.7.6", any clues on how to fix this?
>
> Thanks!
> Alex
>
___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


Re: Python client error

2014-08-15 Thread Alex De la rosa
Thanks for your reply, I already fixed it deleting everything and using
"pip install riak" instead.

Thanks!
Alex


On Fri, Aug 15, 2014 at 5:59 PM, tele  wrote:

> Hi Alex,
>
> Try with: pip install cryptography
>
> :tele
>
>
> On Fri, 15 Aug 2014 17:29:29 +0200
> Alex De la rosa  wrote:
>
> > Hi there,
> >
> > I installed riak-2.0rc1 and the Python client through "easy_intall
> > riak", however, when importing the "riak" library I got the following
> > error:
> >
> > Traceback (most recent call last):
> >   File "x.py", line 1, in 
> > import riak
> >   File
> >
> "/usr/local/lib/python2.7/dist-packages/riak-2.1.0rc1-py2.7.egg/riak/__init__.py",
> > line 59, in 
> >   File
> >
> "/usr/local/lib/python2.7/dist-packages/riak-2.1.0rc1-py2.7.egg/riak/client/__init__.py",
> > line 29, in 
> >   File
> >
> "/usr/local/lib/python2.7/dist-packages/riak-2.1.0rc1-py2.7.egg/riak/client/operations.py",
> > line 19, in 
> >   File
> >
> "/usr/local/lib/python2.7/dist-packages/riak-2.1.0rc1-py2.7.egg/riak/client/transport.py",
> > line 20, in 
> >   File
> >
> "/usr/local/lib/python2.7/dist-packages/riak-2.1.0rc1-py2.7.egg/riak/transports/pbc/__init__.py",
> > line 25, in 
> >   File
> >
> "/usr/local/lib/python2.7/dist-packages/riak-2.1.0rc1-py2.7.egg/riak/transports/pbc/transport.py",
> > line 27, in 
> >   File
> >
> "/usr/local/lib/python2.7/dist-packages/riak-2.1.0rc1-py2.7.egg/riak/transports/pbc/connection.py",
> > line 22, in 
> >   File
> >
> "/usr/local/lib/python2.7/dist-packages/riak-2.1.0rc1-py2.7.egg/riak/security.py",
> > line 19, in 
> >   File "build/bdist.linux-x86_64/egg/OpenSSL/__init__.py", line 8, in
> > 
> >   File "build/bdist.linux-x86_64/egg/OpenSSL/rand.py", line 11, in
> >  File "build/bdist.linux-x86_64/egg/OpenSSL/_util.py", line
> > 3, in  ImportError: No module named
> > cryptography.hazmat.bindings.openssl.binding
> >
> > I'm using "Python 2.7.6", any clues on how to fix this?
> >
> > Thanks!
> > Alex
>
>
___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


Python library: Error with counters

2014-08-15 Thread Alex De la rosa
Hi there,

I created a "counter" bucket called "likes" with the following shell script:

riak-admin bucket-type create likes '{"props":{"datatype":"counter"}}'

When I try to follow the guide [
http://docs.basho.com/riak/2.0.0/dev/using/data-types ] to use this bucket
with Python, I found the following issue:

Traceback (most recent call last):
  File "x.py", line 17, in 
bucket = client.bucket_type('counter_bucket').bucket('likes')
AttributeError: 'RiakClient' object has no attribute 'bucket_type'

Something wrong? Is a fresh install from "pip" so I thought the Python
library would be in its last updated version?

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


Re: Python library: Error with counters

2014-08-15 Thread Alex De la rosa
Hi, thanks for your suggestion, but I would prefer to use the official
packages, and for what I saw on the list some days ago, the new version was
published, so I wonder why is not yet working.

Thanks,
Alex


On Fri, Aug 15, 2014 at 6:20 PM, tele  wrote:

> Hi Alex,
>
> Use the version from git and see if you get the same error:
>
> git clone https://github.com/basho/riak-python-client.git
> cd riak-python-client
> python setup.py install
>
> :tele
>
>
> On Fri, 15 Aug 2014 18:12:09 +0200
> Alex De la rosa  wrote:
>
> > Hi there,
> >
> > I created a "counter" bucket called "likes" with the following shell
> > script:
> >
> > riak-admin bucket-type create likes '{"props":{"datatype":"counter"}}'
> >
> > When I try to follow the guide [
> > http://docs.basho.com/riak/2.0.0/dev/using/data-types ] to use this
> > bucket with Python, I found the following issue:
> >
> > Traceback (most recent call last):
> >   File "x.py", line 17, in 
> > bucket = client.bucket_type('counter_bucket').bucket('likes')
> > AttributeError: 'RiakClient' object has no attribute 'bucket_type'
> >
> > Something wrong? Is a fresh install from "pip" so I thought the Python
> > library would be in its last updated version?
> >
> > Thanks!
> > Alex
>
>
___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


Re: Python library: Error with counters

2014-08-15 Thread Alex De la rosa
Hi Sean,

I activated the bucket as follows:

riak-admin bucket-type create likes '{"props":{"datatype":"counter"}}'

So in theory is good to go; seems I have version 2.0.3 installed instead of
2.1.0rc1. It might be this. If I install it with your command, would I have
any compatibility issues once the final version is released?

Thanks!
Alex


On Fri, Aug 15, 2014 at 7:07 PM, Sean Cribbs  wrote:

> Hi Alex,
>
> The published version is not a final release, so it won't be
> automatically installed by pip. Try this: pip install riak==2.1.0rc1
>
> Also, did you activate your bucket-type using riak-admin? It won't be
> usable until it's activated.
>
> On Fri, Aug 15, 2014 at 12:02 PM, Alex De la rosa
>  wrote:
> > Hi, thanks for your suggestion, but I would prefer to use the official
> > packages, and for what I saw on the list some days ago, the new version
> was
> > published, so I wonder why is not yet working.
> >
> > Thanks,
> > Alex
> >
> >
> > On Fri, Aug 15, 2014 at 6:20 PM, tele  wrote:
> >>
> >> Hi Alex,
> >>
> >> Use the version from git and see if you get the same error:
> >>
> >> git clone https://github.com/basho/riak-python-client.git
> >> cd riak-python-client
> >> python setup.py install
> >>
> >> :tele
> >>
> >>
> >> On Fri, 15 Aug 2014 18:12:09 +0200
> >> Alex De la rosa  wrote:
> >>
> >> > Hi there,
> >> >
> >> > I created a "counter" bucket called "likes" with the following shell
> >> > script:
> >> >
> >> > riak-admin bucket-type create likes '{"props":{"datatype":"counter"}}'
> >> >
> >> > When I try to follow the guide [
> >> > http://docs.basho.com/riak/2.0.0/dev/using/data-types ] to use this
> >> > bucket with Python, I found the following issue:
> >> >
> >> > Traceback (most recent call last):
> >> >   File "x.py", line 17, in 
> >> > bucket = client.bucket_type('counter_bucket').bucket('likes')
> >> > AttributeError: 'RiakClient' object has no attribute 'bucket_type'
> >> >
> >> > Something wrong? Is a fresh install from "pip" so I thought the Python
> >> > library would be in its last updated version?
> >> >
> >> > Thanks!
> >> > Alex
> >>
> >
> >
> > ___
> > riak-users mailing list
> > riak-users@lists.basho.com
> > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
> >
>
>
>
> --
> Sean Cribbs 
> Software Engineer
> Basho Technologies, Inc.
> http://basho.com/
>
___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


Re: Python library: Error with counters

2014-08-15 Thread Alex De la rosa
Hi Luc,

Thanks for your input! I missed that line in the documentation :) is fully
activated now.

Thanks,
Alex


On Fri, Aug 15, 2014 at 7:40 PM, Luc Perkins  wrote:

> Alex,
>
> Creating a bucket type does not also activate it. That is a separate step:
>
> *riak-admin bucket-type activate likes*
>
> If that returns *likes has been activated* or something along those
> lines, then the bucket type is ready to be used.
>
> Luc
>
>
> On Fri, Aug 15, 2014 at 10:37 AM, Alex De la rosa  > wrote:
>
>> Hi Sean,
>>
>> I activated the bucket as follows:
>>
>>
>> riak-admin bucket-type create likes '{"props":{"datatype":"counter"}}'
>>
>> So in theory is good to go; seems I have version 2.0.3 installed instead
>> of 2.1.0rc1. It might be this. If I install it with your command, would I
>> have any compatibility issues once the final version is released?
>>
>> Thanks!
>> Alex
>>
>>
>> On Fri, Aug 15, 2014 at 7:07 PM, Sean Cribbs  wrote:
>>
>>> Hi Alex,
>>>
>>> The published version is not a final release, so it won't be
>>> automatically installed by pip. Try this: pip install riak==2.1.0rc1
>>>
>>> Also, did you activate your bucket-type using riak-admin? It won't be
>>> usable until it's activated.
>>>
>>> On Fri, Aug 15, 2014 at 12:02 PM, Alex De la rosa
>>>  wrote:
>>> > Hi, thanks for your suggestion, but I would prefer to use the official
>>> > packages, and for what I saw on the list some days ago, the new
>>> version was
>>> > published, so I wonder why is not yet working.
>>> >
>>> > Thanks,
>>> > Alex
>>> >
>>> >
>>> > On Fri, Aug 15, 2014 at 6:20 PM, tele  wrote:
>>> >>
>>> >> Hi Alex,
>>> >>
>>> >> Use the version from git and see if you get the same error:
>>> >>
>>> >> git clone https://github.com/basho/riak-python-client.git
>>> >> cd riak-python-client
>>> >> python setup.py install
>>> >>
>>> >> :tele
>>> >>
>>> >>
>>> >> On Fri, 15 Aug 2014 18:12:09 +0200
>>> >> Alex De la rosa  wrote:
>>> >>
>>> >> > Hi there,
>>> >> >
>>> >> > I created a "counter" bucket called "likes" with the following shell
>>> >> > script:
>>> >> >
>>> >> > riak-admin bucket-type create likes
>>> '{"props":{"datatype":"counter"}}'
>>> >> >
>>> >> > When I try to follow the guide [
>>> >> > http://docs.basho.com/riak/2.0.0/dev/using/data-types ] to use this
>>> >> > bucket with Python, I found the following issue:
>>> >> >
>>> >> > Traceback (most recent call last):
>>> >> >   File "x.py", line 17, in 
>>> >> > bucket = client.bucket_type('counter_bucket').bucket('likes')
>>> >> > AttributeError: 'RiakClient' object has no attribute 'bucket_type'
>>> >> >
>>> >> > Something wrong? Is a fresh install from "pip" so I thought the
>>> Python
>>> >> > library would be in its last updated version?
>>> >> >
>>> >> > Thanks!
>>> >> > Alex
>>> >>
>>> >
>>> >
>>> > ___
>>> > riak-users mailing list
>>> > riak-users@lists.basho.com
>>> > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>>> >
>>>
>>>
>>>
>>> --
>>> Sean Cribbs 
>>> Software Engineer
>>> Basho Technologies, Inc.
>>> http://basho.com/
>>>
>>
>>
>> ___
>> 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: Python library: Error with counters

2014-08-17 Thread Alex De la rosa
g_resources.py", line 870, in
obtain

return installer(requirement)

  File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 314, in
fetch_build_egg

return cmd.easy_install(req)

  File
"/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line
616, in easy_install

return self.install_item(spec, dist.location, tmpdir, deps)

  File
"/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line
646, in install_item

dists = self.install_eggs(spec, download, tmpdir)

  File
"/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line
834, in install_eggs

return self.build_and_install(setup_script, setup_base)

  File
"/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line
1040, in build_and_install

self.run_setup(setup_script, setup_base, args)

  File
"/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line
1028, in run_setup

raise DistutilsError("Setup script exited with %s" % (v.args[0],))

distutils.errors.DistutilsError: Setup script exited with error: command
'x86_64-linux-gnu-gcc' failed with exit status 1


Cleaning up...
Command python setup.py egg_info failed with error code 1 in
/tmp/pip_build_root/cryptography
Storing debug log for failure in /root/.pip/pip.log

Thanks,
Alex


On Fri, Aug 15, 2014 at 7:07 PM, Sean Cribbs  wrote:

> Hi Alex,
>
> The published version is not a final release, so it won't be
> automatically installed by pip. Try this: pip install riak==2.1.0rc1
>
> Also, did you activate your bucket-type using riak-admin? It won't be
> usable until it's activated.
>
> On Fri, Aug 15, 2014 at 12:02 PM, Alex De la rosa
>  wrote:
> > Hi, thanks for your suggestion, but I would prefer to use the official
> > packages, and for what I saw on the list some days ago, the new version
> was
> > published, so I wonder why is not yet working.
> >
> > Thanks,
> > Alex
> >
> >
> > On Fri, Aug 15, 2014 at 6:20 PM, tele  wrote:
> >>
> >> Hi Alex,
> >>
> >> Use the version from git and see if you get the same error:
> >>
> >> git clone https://github.com/basho/riak-python-client.git
> >> cd riak-python-client
> >> python setup.py install
> >>
> >> :tele
> >>
> >>
> >> On Fri, 15 Aug 2014 18:12:09 +0200
> >> Alex De la rosa  wrote:
> >>
> >> > Hi there,
> >> >
> >> > I created a "counter" bucket called "likes" with the following shell
> >> > script:
> >> >
> >> > riak-admin bucket-type create likes '{"props":{"datatype":"counter"}}'
> >> >
> >> > When I try to follow the guide [
> >> > http://docs.basho.com/riak/2.0.0/dev/using/data-types ] to use this
> >> > bucket with Python, I found the following issue:
> >> >
> >> > Traceback (most recent call last):
> >> >   File "x.py", line 17, in 
> >> > bucket = client.bucket_type('counter_bucket').bucket('likes')
> >> > AttributeError: 'RiakClient' object has no attribute 'bucket_type'
> >> >
> >> > Something wrong? Is a fresh install from "pip" so I thought the Python
> >> > library would be in its last updated version?
> >> >
> >> > Thanks!
> >> > Alex
> >>
> >
> >
> > ___
> > riak-users mailing list
> > riak-users@lists.basho.com
> > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
> >
>
>
>
> --
> Sean Cribbs 
> Software Engineer
> Basho Technologies, Inc.
> http://basho.com/
>
___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


Re: Python library: Error with counters

2014-08-17 Thread Alex De la rosa
Murphy's law... as soon as I post it, as soon as I found why it failed... I
was missing the following libraries on my Ubuntu Server:

aptitude install build-essential libssl-dev libffi-dev python-dev

After this, the "cryptography" package got installed like a charm.

Thanks!
Alex


On Sun, Aug 17, 2014 at 7:12 PM, Alex De la rosa 
wrote:

> Hi Sean,
>
> I tried to install version 2.1.0rc1 as you suggested, but "pip" gives a
> compilation error and doesn't install it, here you have the log:
>
> # pip install riak==2.1.0rc1
> Downloading/unpacking riak==2.1.0rc1
>   Downloading riak-2.1.0rc1.tar.gz (135kB): 135kB downloaded
>   Running setup.py (path:/tmp/pip_build_root/riak/setup.py) egg_info for
> package riak
>
> Downloading/unpacking riak-pb>=2.0.0 (from riak==2.1.0rc1)
>   Downloading riak_pb-2.0.0.16.tar.gz
>   Running setup.py (path:/tmp/pip_build_root/riak-pb/setup.py) egg_info
> for package riak-pb
>
> Downloading/unpacking pyOpenSSL>=0.14 (from riak==2.1.0rc1)
>   Downloading pyOpenSSL-0.14.tar.gz (128kB): 128kB downloaded
>   Running setup.py (path:/tmp/pip_build_root/pyOpenSSL/setup.py) egg_info
> for package pyOpenSSL
>
> warning: no previously-included files matching '*.pyc' found anywhere
> in distribution
> no previously-included directories found matching 'doc/_build'
> Requirement already satisfied (use --upgrade to upgrade):
> protobuf>=2.4.1,<2.6.0 in /usr/local/lib/python2.7/dist-packages (from
> riak-pb>=2.0.0->riak==2.1.0rc1)
> Downloading/unpacking cryptography>=0.2.1 (from
> pyOpenSSL>=0.14->riak==2.1.0rc1)
>   Downloading cryptography-0.5.3.tar.gz (319kB): 319kB downloaded
>   Running setup.py (path:/tmp/pip_build_root/cryptography/setup.py)
> egg_info for package cryptography
> c/_cffi_backend.c:2:20: fatal error: Python.h: No such file or
> directory
>  #include 
> ^
> compilation terminated.
> Traceback (most recent call last):
>   File "", line 17, in 
>   File "/tmp/pip_build_root/cryptography/setup.py", line 174, in
> 
> "test": PyTest,
>   File "/usr/lib/python2.7/distutils/core.py", line 111, in setup
> _setup_distribution = dist = klass(attrs)
>   File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line
> 239, in __init__
> self.fetch_build_eggs(attrs.pop('setup_requires'))
>   File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line
> 264, in fetch_build_eggs
> replace_conflicting=True
>   File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 620,
> in resolve
> dist = best[req.key] = env.best_match(req, ws, installer)
>   File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 858,
> in best_match
> return self.obtain(req, installer) # try and download/install
>   File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 870,
> in obtain
> return installer(requirement)
>   File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line
> 314, in fetch_build_egg
> return cmd.easy_install(req)
>   File
> "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line
> 616, in easy_install
> return self.install_item(spec, dist.location, tmpdir, deps)
>   File
> "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line
> 646, in install_item
> dists = self.install_eggs(spec, download, tmpdir)
>   File
> "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line
> 834, in install_eggs
> return self.build_and_install(setup_script, setup_base)
>   File
> "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line
> 1040, in build_and_install
> self.run_setup(setup_script, setup_base, args)
>   File
> "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line
> 1028, in run_setup
> raise DistutilsError("Setup script exited with %s" % (v.args[0],))
> distutils.errors.DistutilsError: Setup script exited with error:
> command 'x86_64-linux-gnu-gcc' failed with exit status 1
> Complete output from command python setup.py egg_info:
> c/_cffi_backend.c:2:20: fatal error: Python.h: No such file or
> directory
>
>  #include 
>
> ^
>
> compilation terminated.
>
> Traceback (most recent call last):
>
>   File "", line 17, in 
>
>   File "/tmp/pip_build_root/cryptog

Python: More problems with counters

2014-08-17 Thread Alex De la rosa
Hi there,

I was able to install the latest python client version with "pip install
riak==2.1.0rc1", however, counters still fails to work... I used the
following code ( that is the same as in the documentation ):

bucket = client.bucket_type('counter_bucket').bucket('likes')

however I get the following error:

Traceback (most recent call last):
  File "x.py", line 18, in 
counter = bucket.new('Barcelona')
  File "/usr/local/lib/python2.7/dist-packages/riak/bucket.py", line 159,
in new
if self.bucket_type.datatype:
  File "/usr/local/lib/python2.7/dist-packages/riak/util.py", line 78, in
__get__
value = self.fget(obj)
  File "/usr/local/lib/python2.7/dist-packages/riak/bucket.py", line 618,
in datatype
return self.get_properties().get('datatype')
  File "/usr/local/lib/python2.7/dist-packages/riak/bucket.py", line 557,
in get_properties
return self._client.get_bucket_type_props(self)
  File "/usr/local/lib/python2.7/dist-packages/riak/client/transport.py",
line 184, in wrapper
return self._with_retries(pool, thunk)
  File "/usr/local/lib/python2.7/dist-packages/riak/client/transport.py",
line 126, in _with_retries
return fn(transport)
  File "/usr/local/lib/python2.7/dist-packages/riak/client/transport.py",
line 182, in thunk
return fn(self, transport, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/riak/client/operations.py",
line 265, in get_bucket_type_props
return transport.get_bucket_type_props(bucket_type)
  File
"/usr/local/lib/python2.7/dist-packages/riak/transports/pbc/transport.py",
line 381, in get_bucket_type_props
MSG_CODE_GET_BUCKET_RESP)
  File
"/usr/local/lib/python2.7/dist-packages/riak/transports/pbc/connection.py",
line 50, in _request
return self._recv_msg(expect)
  File
"/usr/local/lib/python2.7/dist-packages/riak/transports/pbc/connection.py",
line 142, in _recv_msg
raise RiakError(err.errmsg)
riak.RiakError: 'Invalid bucket type: <<"counter_bucket">>'

It says the bucket type is wrong (but is the same as in the
documentation)... I tried other combinations and all of them failed too:

riak.RiakError: 'Invalid bucket type: <<"counters_bucket">>'
riak.RiakError: 'Invalid bucket type: <<"counters">>'
riak.RiakError: 'Invalid bucket type: <<"counter">>'

so... no plural, no singular, not isolated... which is the correct
"bucket_type" to use then??

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


Re: Python: More problems with counters

2014-08-17 Thread Alex De la rosa
Hi Eric!

Thank you very much! this certainly solved it! :) however, I have to say
that is very non intuitive as "bucket_type" would look like the data type
(counter, set, map) and the "bucket" part the name of the bucket you
created... so it looks as it should work exactly the contrary as how it has
to be done (><).

However, is finally fixed and I can finally use counters! thank you so much.

Thanks!
Alex


On Sun, Aug 17, 2014 at 8:04 PM, Eric Redmond  wrote:

> Alex,
>
> looking through your previous emails, it looked like you created a bucket
> type named "likes". If that's the case, you'd swap the function params:
>
> bucket = client.bucket_type('likes').bucket('counter_bucket')
>
> Hope that helps,
> Eric
>
>
> On Aug 17, 2014, at 10:33 AM, Alex De la rosa 
> wrote:
>
> > Hi there,
> >
> > I was able to install the latest python client version with "pip install
> riak==2.1.0rc1", however, counters still fails to work... I used the
> following code ( that is the same as in the documentation ):
> >
> > bucket = client.bucket_type('counter_bucket').bucket('likes')
> >
> > however I get the following error:
> >
> > Traceback (most recent call last):
> >   File "x.py", line 18, in 
> > counter = bucket.new('Barcelona')
> >   File "/usr/local/lib/python2.7/dist-packages/riak/bucket.py", line
> 159, in new
> > if self.bucket_type.datatype:
> >   File "/usr/local/lib/python2.7/dist-packages/riak/util.py", line 78,
> in __get__
> > value = self.fget(obj)
> >   File "/usr/local/lib/python2.7/dist-packages/riak/bucket.py", line
> 618, in datatype
> > return self.get_properties().get('datatype')
> >   File "/usr/local/lib/python2.7/dist-packages/riak/bucket.py", line
> 557, in get_properties
> > return self._client.get_bucket_type_props(self)
> >   File
> "/usr/local/lib/python2.7/dist-packages/riak/client/transport.py", line
> 184, in wrapper
> > return self._with_retries(pool, thunk)
> >   File
> "/usr/local/lib/python2.7/dist-packages/riak/client/transport.py", line
> 126, in _with_retries
> > return fn(transport)
> >   File
> "/usr/local/lib/python2.7/dist-packages/riak/client/transport.py", line
> 182, in thunk
> > return fn(self, transport, *args, **kwargs)
> >   File
> "/usr/local/lib/python2.7/dist-packages/riak/client/operations.py", line
> 265, in get_bucket_type_props
> > return transport.get_bucket_type_props(bucket_type)
> >   File
> "/usr/local/lib/python2.7/dist-packages/riak/transports/pbc/transport.py",
> line 381, in get_bucket_type_props
> > MSG_CODE_GET_BUCKET_RESP)
> >   File
> "/usr/local/lib/python2.7/dist-packages/riak/transports/pbc/connection.py",
> line 50, in _request
> > return self._recv_msg(expect)
> >   File
> "/usr/local/lib/python2.7/dist-packages/riak/transports/pbc/connection.py",
> line 142, in _recv_msg
> > raise RiakError(err.errmsg)
> > riak.RiakError: 'Invalid bucket type: <<"counter_bucket">>'
> >
> > It says the bucket type is wrong (but is the same as in the
> documentation)... I tried other combinations and all of them failed too:
> >
> > riak.RiakError: 'Invalid bucket type: <<"counters_bucket">>'
> > riak.RiakError: 'Invalid bucket type: <<"counters">>'
> > riak.RiakError: 'Invalid bucket type: <<"counter">>'
> >
> > so... no plural, no singular, not isolated... which is the correct
> "bucket_type" to use then??
> >
> > Thanks!
> > Alex
> > ___
> > 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: Python library: Error with counters

2014-08-17 Thread Alex De la rosa
Hi Sean,

Yes, after a long time I have it all worked as expected :) thanks

Alex


On Sun, Aug 17, 2014 at 9:16 PM, Sean Cribbs  wrote:

> Glad you figured it out, Alex. I'll make a note to update the README
> about external packages that may be necessary.
>
> On Sun, Aug 17, 2014 at 12:23 PM, Alex De la rosa
>  wrote:
> > Murphy's law... as soon as I post it, as soon as I found why it
> failed... I
> > was missing the following libraries on my Ubuntu Server:
> >
> > aptitude install build-essential libssl-dev libffi-dev python-dev
> >
> > After this, the "cryptography" package got installed like a charm.
> >
> > Thanks!
> > Alex
> >
> >
> > On Sun, Aug 17, 2014 at 7:12 PM, Alex De la rosa <
> alex.rosa@gmail.com>
> > wrote:
> >>
> >> Hi Sean,
> >>
> >> I tried to install version 2.1.0rc1 as you suggested, but "pip" gives a
> >> compilation error and doesn't install it, here you have the log:
> >>
> >> # pip install riak==2.1.0rc1
> >> Downloading/unpacking riak==2.1.0rc1
> >>   Downloading riak-2.1.0rc1.tar.gz (135kB): 135kB downloaded
> >>   Running setup.py (path:/tmp/pip_build_root/riak/setup.py) egg_info for
> >> package riak
> >>
> >> Downloading/unpacking riak-pb>=2.0.0 (from riak==2.1.0rc1)
> >>   Downloading riak_pb-2.0.0.16.tar.gz
> >>   Running setup.py (path:/tmp/pip_build_root/riak-pb/setup.py) egg_info
> >> for package riak-pb
> >>
> >> Downloading/unpacking pyOpenSSL>=0.14 (from riak==2.1.0rc1)
> >>   Downloading pyOpenSSL-0.14.tar.gz (128kB): 128kB downloaded
> >>   Running setup.py (path:/tmp/pip_build_root/pyOpenSSL/setup.py)
> egg_info
> >> for package pyOpenSSL
> >>
> >> warning: no previously-included files matching '*.pyc' found
> anywhere
> >> in distribution
> >> no previously-included directories found matching 'doc/_build'
> >> Requirement already satisfied (use --upgrade to upgrade):
> >> protobuf>=2.4.1,<2.6.0 in /usr/local/lib/python2.7/dist-packages (from
> >> riak-pb>=2.0.0->riak==2.1.0rc1)
> >> Downloading/unpacking cryptography>=0.2.1 (from
> >> pyOpenSSL>=0.14->riak==2.1.0rc1)
> >>   Downloading cryptography-0.5.3.tar.gz (319kB): 319kB downloaded
> >>   Running setup.py (path:/tmp/pip_build_root/cryptography/setup.py)
> >> egg_info for package cryptography
> >> c/_cffi_backend.c:2:20: fatal error: Python.h: No such file or
> >> directory
> >>  #include 
> >> ^
> >> compilation terminated.
> >> Traceback (most recent call last):
> >>   File "", line 17, in 
> >>   File "/tmp/pip_build_root/cryptography/setup.py", line 174, in
> >> 
> >> "test": PyTest,
> >>   File "/usr/lib/python2.7/distutils/core.py", line 111, in setup
> >> _setup_distribution = dist = klass(attrs)
> >>   File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line
> >> 239, in __init__
> >> self.fetch_build_eggs(attrs.pop('setup_requires'))
> >>   File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line
> >> 264, in fetch_build_eggs
> >> replace_conflicting=True
> >>   File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line
> 620,
> >> in resolve
> >> dist = best[req.key] = env.best_match(req, ws, installer)
> >>   File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line
> 858,
> >> in best_match
> >> return self.obtain(req, installer) # try and download/install
> >>   File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line
> 870,
> >> in obtain
> >> return installer(requirement)
> >>   File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line
> >> 314, in fetch_build_egg
> >> return cmd.easy_install(req)
> >>   File
> >> "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py",
> line
> >> 616, in easy_install
> >> return self.install_item(spec, dist.location, tmpdir, deps)
> >>   File
> >> "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py",
> line
> >> 646, in inst

Help: Riak Search on Counters

2014-08-18 Thread Alex De la rosa
Hi there,

Can somebody help me with Riak Search 2.0 on Counters? Imagine we have a
counter called "visitors" to store how many people visits certain cities:

              
        

  client.create_search_index('testing')
  bucket = client.bucket_type('visitors').bucket('counter_bucket')
  bucket.enable_search()
  bucket.set_property('search_index', 'testing')

  c = bucket.new('Barcelona')
  c.increment(5)
  c.store()

  c = bucket.new('Tokyo')
  c.increment(2)
  c.store()

  c = bucket.new('Paris')
  c.increment(4)
  c.store()

              
        

How would we use Riak Search 2.0 in this "visitors" bucket to get which
city has more visitors? (in this case Barcelona)

              
        

  r = bucket.search('?') # <---  Pattern to fill up

              
        

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


Riak Search Issue

2014-08-18 Thread Alex De la rosa
Hi there,

I had been following the documentation [
http://docs.basho.com/riak/2.0.0/dev/using/search/ ] about Riak Search and
the code provided in the site doesn't seem to work?

Everything I try ends up with an error saying no index found taking the
name of the bucket as a not found index :(

riak.RiakError: 'No index <<"name_of_the_bucket">> found.'

Somebody knows what's going on?

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


Re: Riak Search Issue

2014-08-18 Thread Alex De la rosa
If I do this, I got the right index:

http://RIAK:8098/search/index/famous
=> {"name":"famous","n_val":3,"schema":"_yz_default"}

If I do this, I get an error:
http://RIAK:8098/search/index/animals
=> not found

What I don't understand is why it believes the index is the bucket name and
not the index I created for it?

riak-admin bucket-type create animals '{"props":{"search_index":"famous"}}'
riak-admin bucket-type activate animals

Shouldn't it be looking for a "famous" index instead of an "animals" index??

Thanks!
Alex


On Mon, Aug 18, 2014 at 4:26 PM, Luke Bakken  wrote:

> What is the output of this command? Please replace RIAK_HOST and
> "name_of_the_bucket" with the correct information:
>
> curl "$RIAK_HOST/search/index/name_of_the_bucket"
>
> If the above returns a 404, please use this guide to ensure you've
> created the index correctly:
>
> http://docs.basho.com/riak/2.0.0/dev/using/search/
>
> If you expect the index to be there and it is not, the solr.log file
> in /var/log/riak could provide a clue.
>
> --
> Luke Bakken
> CSE
> lbak...@basho.com
>
>
> On Mon, Aug 18, 2014 at 6:59 AM, Alex De la rosa
>  wrote:
> > Hi there,
> >
> > I had been following the documentation [
> > http://docs.basho.com/riak/2.0.0/dev/using/search/ ] about Riak Search
> and
> > the code provided in the site doesn't seem to work?
> >
> > Everything I try ends up with an error saying no index found taking the
> name
> > of the bucket as a not found index :(
> >
> > riak.RiakError: 'No index <<"name_of_the_bucket">> found.'
> >
> > Somebody knows what's going on?
> >
> > Thanks!
> > Alex
> >
> >
> > ___
> > 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: Riak Search Issue

2014-08-18 Thread Alex De la rosa
Hi Luke,

I also tried with a normal bucket "cats" using the type "animals" as the
documentation seemed to suggest and gave me the same error but this time
saying that "cats" was not found as an index... so... still no clue how to
do it.

This is an alternate code I did looking at the Python client API
documentation, etc...

client.create_search_index('men')
bucket = client.bucket('accounts')
bucket.enable_search()
bucket.set_property('search_index', 'men')
key = bucket.new('alex', data={"username":"Alex","age":25,"sex":"male"},
content_type='application/json')
key.store()
print bucket.search('sex=male')

Again, it says "accounts" is not an index... in this code no bucket types
are used, just a plain bucket "accounts"... what is wrong? what is missing
for it to work??

This is really frustrating.

Thanks,
Alex


On Mon, Aug 18, 2014 at 4:44 PM, Luke Bakken  wrote:

> Hi Alex -
>
> You correctly created the "famous" index, as well as correctly
> associated it with the bucket *type* "animals". Note that a bucket
> type is not the same thing as a bucket in previous versions of Riak. A
> bucket type is a way to give 1 or more buckets within that type the
> same properties. You'll have to use different code in your Riak client
> to use bucket types:
>
> http://docs.basho.com/riak/2.0.0/dev/advanced/bucket-types/
>
> --
> Luke Bakken
> CSE
> lbak...@basho.com
>
>
> On Mon, Aug 18, 2014 at 7:32 AM, Alex De la rosa
>  wrote:
> > If I do this, I got the right index:
> >
> > http://RIAK:8098/search/index/famous
> > => {"name":"famous","n_val":3,"schema":"_yz_default"}
> >
> > If I do this, I get an error:
> > http://RIAK:8098/search/index/animals
> > => not found
> >
> > What I don't understand is why it believes the index is the bucket name
> and
> > not the index I created for it?
> >
> > riak-admin bucket-type create animals
> '{"props":{"search_index":"famous"}}'
> > riak-admin bucket-type activate animals
> >
> > Shouldn't it be looking for a "famous" index instead of an "animals"
> index??
> >
> > Thanks!
> > Alex
> >
> >
> > On Mon, Aug 18, 2014 at 4:26 PM, Luke Bakken  wrote:
> >>
> >> What is the output of this command? Please replace RIAK_HOST and
> >> "name_of_the_bucket" with the correct information:
> >>
> >> curl "$RIAK_HOST/search/index/name_of_the_bucket"
> >>
> >> If the above returns a 404, please use this guide to ensure you've
> >> created the index correctly:
> >>
> >> http://docs.basho.com/riak/2.0.0/dev/using/search/
> >>
> >> If you expect the index to be there and it is not, the solr.log file
> >> in /var/log/riak could provide a clue.
> >>
> >> --
> >> Luke Bakken
> >> CSE
> >> lbak...@basho.com
> >>
> >>
> >> On Mon, Aug 18, 2014 at 6:59 AM, Alex De la rosa
> >>  wrote:
> >> > Hi there,
> >> >
> >> > I had been following the documentation [
> >> > http://docs.basho.com/riak/2.0.0/dev/using/search/ ] about Riak
> Search
> >> > and
> >> > the code provided in the site doesn't seem to work?
> >> >
> >> > Everything I try ends up with an error saying no index found taking
> the
> >> > name
> >> > of the bucket as a not found index :(
> >> >
> >> > riak.RiakError: 'No index <<"name_of_the_bucket">> found.'
> >> >
> >> > Somebody knows what's going on?
> >> >
> >> > Thanks!
> >> > Alex
>
___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


Re: Riak Search Issue

2014-08-18 Thread Alex De la rosa
Hi Luke,

Same error:

bucket = client.bucket_type('animals').bucket('cats')
bucket.enable_search()
bucket.set_property('search_index', 'famous') # NEW: Setting the search
index to the bucket
key = bucket.new('feliz', data={"name":"Felix","species":"Felis catus"},
content_type='application/json')
key.store()
print bucket.search('name=Felix')

Output:

Traceback (most recent call last):
  File "x.py", line 11, in 
print bucket.search('name=Felix')
  File "/usr/local/lib/python2.7/dist-packages/riak/bucket.py", line 420,
in search
return self._client.fulltext_search(self.name, query, **params)
  File "/usr/local/lib/python2.7/dist-packages/riak/client/transport.py",
line 184, in wrapper
return self._with_retries(pool, thunk)
  File "/usr/local/lib/python2.7/dist-packages/riak/client/transport.py",
line 126, in _with_retries
return fn(transport)
  File "/usr/local/lib/python2.7/dist-packages/riak/client/transport.py",
line 182, in thunk
return fn(self, transport, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/riak/client/operations.py",
line 573, in fulltext_search
return transport.search(index, query, **params)
  File
"/usr/local/lib/python2.7/dist-packages/riak/transports/pbc/transport.py",
line 564, in search
MSG_CODE_SEARCH_QUERY_RESP)
  File
"/usr/local/lib/python2.7/dist-packages/riak/transports/pbc/connection.py",
line 50, in _request
return self._recv_msg(expect)
  File
"/usr/local/lib/python2.7/dist-packages/riak/transports/pbc/connection.py",
line 142, in _recv_msg
raise RiakError(err.errmsg)
riak.RiakError: 'No index <<"cats">> found.'

Thanks,
Alex


On Mon, Aug 18, 2014 at 5:00 PM, Luke Bakken  wrote:

> Alex -
>
> Let's take a step back and try out the "famous" index and "animals"
> bucket type, which you have confirmed are set up correctly. This
> (untested) code should create an object ("cat-1") in the "cats" bucket
> (within the "animals" bucket type), which will then be indexed by the
> "famous" index:
>
> bucket = client.bucket_type('animals').bucket('cats')
> obj = RiakObject(client, bucket, 'cat-1')
> obj.content_type = 'application/json'
> obj.data = { 'name': 'Felix', 'species': 'Felis catus' }
> obj.store()
>
> --
> Luke Bakken
> CSE
> lbak...@basho.com
>
> On Mon, Aug 18, 2014 at 7:50 AM, Alex De la rosa
>  wrote:
> > Hi Luke,
> >
> > I also tried with a normal bucket "cats" using the type "animals" as the
> > documentation seemed to suggest and gave me the same error but this time
> > saying that "cats" was not found as an index... so... still no clue how
> to
> > do it.
> >
> > This is an alternate code I did looking at the Python client API
> > documentation, etc...
> >
> > client.create_search_index('men')
> > bucket = client.bucket('accounts')
> > bucket.enable_search()
> > bucket.set_property('search_index', 'men')
> > key = bucket.new('alex', data={"username":"Alex","age":25,"sex":"male"},
> > content_type='application/json')
> > key.store()
> > print bucket.search('sex=male')
> >
> > Again, it says "accounts" is not an index... in this code no bucket types
> > are used, just a plain bucket "accounts"... what is wrong? what is
> missing
> > for it to work??
> >
> > This is really frustrating.
> >
> > Thanks,
> > Alex
> >
> >
> > On Mon, Aug 18, 2014 at 4:44 PM, Luke Bakken  wrote:
> >>
> >> Hi Alex -
> >>
> >> You correctly created the "famous" index, as well as correctly
> >> associated it with the bucket *type* "animals". Note that a bucket
> >> type is not the same thing as a bucket in previous versions of Riak. A
> >> bucket type is a way to give 1 or more buckets within that type the
> >> same properties. You'll have to use different code in your Riak client
> >> to use bucket types:
> >>
> >> http://docs.basho.com/riak/2.0.0/dev/advanced/bucket-types/
> >>
> >> --
> >> Luke Bakken
> >> CSE
> >> lbak...@basho.com
>
___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


Re: Riak Search Issue

2014-08-18 Thread Alex De la rosa
Hi Luke,

Yes, I'm using the version 2.1.0rc1 installed via PIP as explained by Sean
in another thread here.

Thanks,
Alex


On Mon, Aug 18, 2014 at 5:57 PM, Luke Bakken  wrote:

> Hi Alex,
>
> I'll work on reproducing this error, thank you for the details. I'm
> assuming you're using the 2.1.0rc1 version of the Python client
> available here:
>
> https://pypi.python.org/pypi?:action=display&name=riak#downloads
>
> --
> Luke Bakken
> CSE
> lbak...@basho.com
>
>
> On Mon, Aug 18, 2014 at 8:47 AM, Alex De la rosa
>  wrote:
> > Hi Luke,
> >
> > Same error:
> >
> > bucket = client.bucket_type('animals').bucket('cats')
> > bucket.enable_search()
> > bucket.set_property('search_index', 'famous') # NEW: Setting the search
> > index to the bucket
> > key = bucket.new('feliz', data={"name":"Felix","species":"Felis catus"},
> > content_type='application/json')
> > key.store()
> > print bucket.search('name=Felix')
> >
> > Output:
> >
> > Traceback (most recent call last):
> >   File "x.py", line 11, in 
> > print bucket.search('name=Felix')
> >   File "/usr/local/lib/python2.7/dist-packages/riak/bucket.py", line
> 420, in
> > search
> > return self._client.fulltext_search(self.name, query, **params)
> >   File "/usr/local/lib/python2.7/dist-packages/riak/client/transport.py",
> > line 184, in wrapper
> > return self._with_retries(pool, thunk)
> >   File "/usr/local/lib/python2.7/dist-packages/riak/client/transport.py",
> > line 126, in _with_retries
> > return fn(transport)
> >   File "/usr/local/lib/python2.7/dist-packages/riak/client/transport.py",
> > line 182, in thunk
> > return fn(self, transport, *args, **kwargs)
> >   File
> "/usr/local/lib/python2.7/dist-packages/riak/client/operations.py",
> > line 573, in fulltext_search
> > return transport.search(index, query, **params)
> >   File
> >
> "/usr/local/lib/python2.7/dist-packages/riak/transports/pbc/transport.py",
> > line 564, in search
> > MSG_CODE_SEARCH_QUERY_RESP)
> >   File
> >
> "/usr/local/lib/python2.7/dist-packages/riak/transports/pbc/connection.py",
> > line 50, in _request
> > return self._recv_msg(expect)
> >   File
> >
> "/usr/local/lib/python2.7/dist-packages/riak/transports/pbc/connection.py",
> > line 142, in _recv_msg
> > raise RiakError(err.errmsg)
> > riak.RiakError: 'No index <<"cats">> found.'
> >
> > Thanks,
> > Alex
> >
> >
> > On Mon, Aug 18, 2014 at 5:00 PM, Luke Bakken  wrote:
> >>
> >> Alex -
> >>
> >> Let's take a step back and try out the "famous" index and "animals"
> >> bucket type, which you have confirmed are set up correctly. This
> >> (untested) code should create an object ("cat-1") in the "cats" bucket
> >> (within the "animals" bucket type), which will then be indexed by the
> >> "famous" index:
> >>
> >> bucket = client.bucket_type('animals').bucket('cats')
> >> obj = RiakObject(client, bucket, 'cat-1')
> >> obj.content_type = 'application/json'
> >> obj.data = { 'name': 'Felix', 'species': 'Felis catus' }
> >> obj.store()
> >>
> >> --
> >> Luke Bakken
> >> CSE
> >> lbak...@basho.com
> >>
> >> On Mon, Aug 18, 2014 at 7:50 AM, Alex De la rosa
> >>  wrote:
> >> > Hi Luke,
> >> >
> >> > I also tried with a normal bucket "cats" using the type "animals" as
> the
> >> > documentation seemed to suggest and gave me the same error but this
> time
> >> > saying that "cats" was not found as an index... so... still no clue
> how
> >> > to
> >> > do it.
> >> >
> >> > This is an alternate code I did looking at the Python client API
> >> > documentation, etc...
> >> >
> >> > client.create_search_index('men')
> >> > bucket = client.bucket('accounts')
> >> > bucket.enable_search()
> >> > bucket.set_property('search_index', 'men')
> >> > key = bucket.new('alex

Re: Riak Search Issue

2014-08-18 Thread Alex De la rosa
In case is of help, here are the steps I followed:

              
          
STEP 1: CREATE SEARCH INDEX: mywantedindex
              
          
PYTHON:
  client.create_search_index('mywantedindex')

              
          
STEP 2: VERIFY INDEX
              
          
CURL:
  http://RIAK:8098/search/index/mywantedindex
  => {"name":"mywantedindex","n_val":3,"schema":"_yz_default"}

              
          
STEP 3: CREATE BUCKET TYPE: anothertry
              
          
SHELL:
  riak-admin bucket-type create anothertry
'{"props":{"search_index":"mywantedindex"}}'
  => anothertry created
  riak-admin bucket-type activate anothertry
  => anothertry has been activated

              
          
STEP 4: CREATE BUCKET TO STORE OBJECTS: pleasework
              
          
PYTHON:
  bucket = client.bucket_type('anothertry').bucket('pleasework')
  bucket.enable_search()
  bucket.set_property('search_index', 'mywantedindex')
  key = bucket.new('cat-1', data={"name":"Felix","species":"Felis catus"},
content_type='application/json')
  key.store()
  print bucket.search('name=Felix')

              
          
RESULT: ERROR!
  ---- ---- ---- ----         
          
riak.RiakError: 'No index <<"pleasework">> found.'

Thanks,
Alex


On Mon, Aug 18, 2014 at 5:59 PM, Alex De la rosa 
wrote:

> Hi Luke,
>
> Yes, I'm using the version 2.1.0rc1 installed via PIP as explained by Sean
> in another thread here.
>
> Thanks,
> Alex
>
>
> On Mon, Aug 18, 2014 at 5:57 PM, Luke Bakken  wrote:
>
>> Hi Alex,
>>
>> I'll work on reproducing this error, thank you for the details. I'm
>> assuming you're using the 2.1.0rc1 version of the Python client
>> available here:
>>
>> https://pypi.python.org/pypi?:action=display&name=riak#downloads
>>
>> --
>> Luke Bakken
>> CSE
>> lbak...@basho.com
>>
>>
>> On Mon, Aug 18, 2014 at 8:47 AM, Alex De la rosa
>>  wrote:
>> > Hi Luke,
>> >
>> > Same error:
>> >
>> > bucket = client.bucket_type('animals').bucket('cats')
>> > bucket.enable_search()
>> > bucket.set_property('search_index', 'famous') # NEW: Setting the search
>> > index to the bucket
>> > key = bucket.new('feliz', data={"name":"Felix","species":"Felis catus"},
>> > content_type='application/json')
>> > key.store()
>> > print bucket.search('name=Felix')
>> >
>> > Output:
>> >
>> > Traceback (most recent call last):
>> >   File "x.py", line 11, in 
>> > print bucket.search('name=Felix')
>> >   File "/usr/local/lib/python2.7/dist-packages/riak/bucket.py", line
>> 420, in
>> > search
>> > return self._client.fulltext_search(self.name, query, **params)
>> >   File
>> "/usr/local/lib/python2.7/dist-packages/riak/client/transport.py",
>> > line 184, in wrapper
>> > return self._with_retries(pool, thunk)
>> >   File
>> "/usr/local/lib/python2.7/dist-packages/riak/client/transport.py",
>> > line 126, in _with_retries
>> > return fn(transport)
>> >   File
>> "/usr/local/lib/python2.7/dist-packages/riak/client/transport.py",
>> > line 182, in thunk
>> > return fn(self, transport, *args, **kwargs)
>> >   File
>> "/usr/local/lib/python2.7/di

Re: Riak Search Issue

2014-08-18 Thread Alex De la rosa
Hi Luke,

As an alternative version and following the Python Client Documentation I
tried these steps without a bucket_type (although I ended in the same
error):

              
          
STEP 1: CREATE SEARCH INDEX: mywantedindex
              
          
PYTHON:
  client.create_search_index('mywantedindex')

              
          
STEP 2: VERIFY INDEX
              
          
CURL:
  http://RIAK:8098/search/index/mywantedindex
<http://riak:8098/search/index/mywantedindex>
  => {"name":"mywantedindex","n_val":3,"schema":"_yz_default"}

              
          
STEP 3: CREATE BUCKET: pleasework3
              
          
PYTHON:
  bucket = client.bucket('pleasework3')
  bucket.enable_search()
  bucket.set_property('search_index', 'mywantedindex')

              
          
STEP 4: VERIFY BUCKET PROPS
              
          
CURL:
  http://RIAK:8098/riak/pleasework3
  =>
{"props":{"allow_mult":false,"basic_quorum":false,"big_vclock":50,"chash_keyfun":{"mod":"riak_core_util","fun":"chash_std_keyfun"},"dvv_enabled":false,"dw":"quorum","last_write_wins":false,"linkfun":{"mod":"riak_kv_wm_link_walker","fun":"mapreduce_linkfun"},"n_val":3,"name":"pleasework3","notfound_ok":true,"old_vclock":86400,"postcommit":[],"pr":0,"precommit":[],"pw":0,"r":"quorum","rw":"quorum","search":true,"search_index":"mywantedindex","small_vclock":50,"w":"quorum","young_vclock":20}}

              
          
RESULT: ERROR!
 ---- ----            
          
PYTHON:
  print bucket.search('name=Felix')
  => riak.RiakError: 'No index <<"pleasework3">> found.'

At least I can see the "search_index":"mywantedindex" prop set up properly
in the bucket but still getting the same error no matter what I try; I
think is possible there is a bug in the Python client?

Thanks,
Alex


On Mon, Aug 18, 2014 at 6:14 PM, Alex De la rosa 
wrote:

> In case is of help, here are the steps I followed:
>
>               
>           
> STEP 1: CREATE SEARCH INDEX: mywantedindex
>               
>           
> PYTHON:
>   client.create_search_index('mywantedindex')
>
>               
>           
> STEP 2: VERIFY INDEX
>               
>           
> CURL:
>   http://RIAK:8098/search/index/mywantedindex
>   => {"name":"mywantedindex","n_val":3,"schema":"_yz_default"}
>
>               
>           
> STEP 3: CREATE BUCKET TYPE: anothertry
>               
>           
> SHELL:
>   riak-admin bucket-type create anothertry
> '{"props":{"search_index":"mywantedindex"}}'
>   => anothertry cr

Re: Help: Riak Search on Counters

2014-08-18 Thread Alex De la rosa
Hi Sean,

Thank you for the "counter" field trick :)

What id you don't know the max value and you want the top 5 cities? In your
example you assume 3 or upper.

Thanks!
Alex

On Monday, August 18, 2014, Sean Cribbs  wrote:

> Hi Alex,
>
> Bare counters become the "counter" field in the Solr index. For counts
> greater than 3 you might query with "counter:[3 TO *]".
>
> Hope that helps!
>
> On Mon, Aug 18, 2014 at 8:01 AM, Alex De la rosa
> > wrote:
> > Hi there,
> >
> > Can somebody help me with Riak Search 2.0 on Counters? Imagine we have a
> > counter called "visitors" to store how many people visits certain cities:
> >
> >              
> 
> >         
> >
> >   client.create_search_index('testing')
> >   bucket = client.bucket_type('visitors').bucket('counter_bucket')
> >   bucket.enable_search()
> >   bucket.set_property('search_index', 'testing')
> >
> >   c = bucket.new('Barcelona')
> >   c.increment(5)
> >   c.store()
> >
> >   c = bucket.new('Tokyo')
> >   c.increment(2)
> >   c.store()
> >
> >   c = bucket.new('Paris')
> >   c.increment(4)
> >   c.store()
> >
> >              
> 
> >         
> >
> > How would we use Riak Search 2.0 in this "visitors" bucket to get which
> city
> > has more visitors? (in this case Barcelona)
> >
> >              
> 
> >         
> >
> >   r = bucket.search('?') # <---  Pattern to fill up
> >
> >              
> 
> >         
> >
> > Thanks!
> > Alex
> >
> > ___
> > riak-users mailing list
> > riak-users@lists.basho.com 
> > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
> >
>
>
>
> --
> Sean Cribbs >
> Software Engineer
> Basho Technologies, Inc.
> http://basho.com/
>
___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


Re: Riak Search Issue

2014-08-18 Thread Alex De la rosa
Hi Eric,

I see! Understood, could you provide a little full example on how it should
work? Because I think I also tried without it and failed.

Luke told me to try using the GIT version one see if is a bug that was
already fixed there.

Thanks,
Alex

On Monday, August 18, 2014, Eric Redmond  wrote:

> Alex,
>
> Don't call enable_search(). That enables *old* Riak Search (it sets the
> property "search":true). To revert that setting, bucket.set_property("search",
> False)
>
>
>
> On Aug 18, 2014, at 10:55 AM, Alex De la rosa  > wrote:
>
> Hi Luke,
>
> As an alternative version and following the Python Client Documentation I
> tried these steps without a bucket_type (although I ended in the same
> error):
>
>               
>           
> STEP 1: CREATE SEARCH INDEX: mywantedindex
>               
>           
> PYTHON:
>   client.create_search_index('mywantedindex')
>
>               
>           
> STEP 2: VERIFY INDEX
>               
>           
> CURL:
>   http://RIAK:8098/search/index/mywantedindex
> <http://riak:8098/search/index/mywantedindex>
>   => {"name":"mywantedindex","n_val":3,"schema":"_yz_default"}
>
>               
>           
> STEP 3: CREATE BUCKET: pleasework3
>               
>           
> PYTHON:
>   bucket = client.bucket('pleasework3')
>   bucket.enable_search()
>   bucket.set_property('search_index', 'mywantedindex')
>
>               
>           
> STEP 4: VERIFY BUCKET PROPS
>               
>           
> CURL:
>   http://RIAK:8098/riak/pleasework3 <http://riak:8098/riak/pleasework3>
>   =>
> {"props":{"allow_mult":false,"basic_quorum":false,"big_vclock":50,"chash_keyfun":{"mod":"riak_core_util","fun":"chash_std_keyfun"},"dvv_enabled":false,"dw":"quorum","last_write_wins":false,"linkfun":{"mod":"riak_kv_wm_link_walker","fun":"mapreduce_linkfun"},"n_val":3,"name":"pleasework3","notfound_ok":true,"old_vclock":86400,"postcommit":[],"pr":0,"precommit":[],"pw":0,"r":"quorum","rw":"quorum","search":true,"search_index":"mywantedindex","small_vclock":50,"w":"quorum","young_vclock":20}}
>
>               
>           
> RESULT: ERROR!
>               
>           
> PYTHON:
>   print bucket.search('name=Felix')
>   => riak.RiakError: 'No index <<"pleasework3">> found.'
>
> At least I can see the "search_index":"mywantedindex" prop set up
> properly in the bucket but still getting the same error no matter what I
> try; I think is possible there is a bug in the Python client?
>
> Thanks,
> Alex
>
>
> On Mon, Aug 18, 2014 at 6:14 PM, Alex De la rosa  > wrote:
>
>> In case is of help, here are the steps I followed:
>>
>>              
>>            
>> STEP 1: CREATE SEARCH INDEX: mywantedindex
>>              
>>            
>> PYTHON:
>>   client.create_search_index('mywantedindex')
>>
>>              
>>       -

Re: Help: Riak Search on Counters

2014-08-18 Thread Alex De la rosa
Oh, cool! Thanks! I will have to look for Solr's documentation then ;)

Alex

On Monday, August 18, 2014, Eric Redmond  wrote:

> That's a Solr query, which you can find in the Solr documentation. But my
> initial through would be:
>
> bucket.search("counter:*" sort="counter desc", rows=5)
>
> Eric
>
>
> On Aug 18, 2014, at 12:06 PM, Alex De la rosa  > wrote:
>
> Hi Sean,
>
> Thank you for the "counter" field trick :)
>
> What id you don't know the max value and you want the top 5 cities? In
> your example you assume 3 or upper.
>
> Thanks!
> Alex
>
> On Monday, August 18, 2014, Sean Cribbs  > wrote:
>
>> Hi Alex,
>>
>> Bare counters become the "counter" field in the Solr index. For counts
>> greater than 3 you might query with "counter:[3 TO *]".
>>
>> Hope that helps!
>>
>> On Mon, Aug 18, 2014 at 8:01 AM, Alex De la rosa
>>  wrote:
>> > Hi there,
>> >
>> > Can somebody help me with Riak Search 2.0 on Counters? Imagine we have a
>> > counter called "visitors" to store how many people visits certain
>> cities:
>> >
>> >              
>> 
>> >         
>> >
>> >   client.create_search_index('testing')
>> >   bucket = client.bucket_type('visitors').bucket('counter_bucket')
>> >   bucket.enable_search()
>> >   bucket.set_property('search_index', 'testing')
>> >
>> >   c = bucket.new('Barcelona')
>> >   c.increment(5)
>> >   c.store()
>> >
>> >   c = bucket.new('Tokyo')
>> >   c.increment(2)
>> >   c.store()
>> >
>> >   c = bucket.new('Paris')
>> >   c.increment(4)
>> >   c.store()
>> >
>> >              
>> 
>> >         
>> >
>> > How would we use Riak Search 2.0 in this "visitors" bucket to get which
>> city
>> > has more visitors? (in this case Barcelona)
>> >
>> >              
>> 
>> >         
>> >
>> >   r = bucket.search('?') # <---  Pattern to fill up
>> >
>> >              
>> 
>> >         
>> >
>> > Thanks!
>> > Alex
>> >
>> > ___
>> > riak-users mailing list
>> > riak-users@lists.basho.com
>> > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>> >
>>
>>
>>
>> --
>> Sean Cribbs 
>> Software Engineer
>> Basho Technologies, Inc.
>> http://basho.com/
>>
> ___
> 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: Riak Search Issue

2014-08-18 Thread Alex De la rosa
Ok, I found the first error in the documentation, parameters are in reverse
order:

bucket = client.bucket('animals', 'cats')

should be:

bucket = client.bucket('cats', 'animals')

Now I could save and it found the bucket type: bucket =
client.bucket('fcb','futbolistas') VS bucket = client.bucket('futbolistas',
'fcb')

However, even fixing that, the next step fails as it was failing before:

              
        
PYTHON:
  bucket = client.bucket('fcb','futbolistas')
  results = bucket.search('name_s:Lion*')
  print results
              
        
Traceback (most recent call last):
  File "x.py", line 13, in 
results = bucket.search('name_s:Lion*')
  File "/usr/local/lib/python2.7/dist-packages/riak/bucket.py", line 420,
in search
return self._client.fulltext_search(self.name, query, **params)
  File "/usr/local/lib/python2.7/dist-packages/riak/client/transport.py",
line 184, in wrapper
return self._with_retries(pool, thunk)
  File "/usr/local/lib/python2.7/dist-packages/riak/client/transport.py",
line 126, in _with_retries
return fn(transport)
  File "/usr/local/lib/python2.7/dist-packages/riak/client/transport.py",
line 182, in thunk
return fn(self, transport, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/riak/client/operations.py",
line 573, in fulltext_search
return transport.search(index, query, **params)
  File
"/usr/local/lib/python2.7/dist-packages/riak/transports/pbc/transport.py",
line 564, in search
MSG_CODE_SEARCH_QUERY_RESP)
  File
"/usr/local/lib/python2.7/dist-packages/riak/transports/pbc/connection.py",
line 50, in _request
return self._recv_msg(expect)
  File
"/usr/local/lib/python2.7/dist-packages/riak/transports/pbc/connection.py",
line 142, in _recv_msg
raise RiakError(err.errmsg)
riak.RiakError: 'No index <<"fcb">> found.'

Again it says "fcb" index not found... and this time I fully followed the
right documentation and didn't use "bucket.enable_search()"

Thanks,
Alex


On Mon, Aug 18, 2014 at 10:49 PM, Alex De la rosa 
wrote:

> Hi Eric,
>
> I'm sorry but I followed the documentation that you provided me and still
> raises issues:
>
>               
>         
> STEP 1: Create Index: famoso
>               
>         
> PYTHON:
>   client.create_search_index('famoso')
>
>               
>         
> STEP 2: Create Bucket Type: futbolistas
>               
>         
> SHELL:
>   riak-admin bucket-type create futbolistas
> '{"props":{"search_index":"famoso"}}'
>   => futbolistas created
>   riak-admin bucket-type activate futbolistas
>   => futbolistas has been activated
>
>               
>         
> STEP 3: Create Bucket and Add data: fcb
>               
>         
> PYTHON:
>   bucket = client.bucket('futbolistas', 'fcb')
>   c = bucket.new('lionel', {'name_s': 'Lionel', 'age_i': 30, 'leader_b':
> True})
>   c.store()
>
>               
>         
> ERROR: This time it doesn't even let me save data into Riak
>               
>         
> Traceback (most recent call last):
>   File "x.py", line 10, in 
> c = bucket.new('lionel', {'name_s': 'Lionel', 'age_i': 30, 'leader_b':
> True})
>   File "/usr/local/lib/python2.7/dist-packages/riak/bucket.py", line 159,
> in new
> if self.bucket_type.datatype:
>   File "/usr/local/lib/python2.7/dist-packages/riak/util.py", line 78, in
> __get__
> value = self.fget(obj)
>   File "/usr/local/lib/python2

Re: Riak Search Issue

2014-08-18 Thread Alex De la rosa
Yes, I did it in purpose, because I did so many testings that I wanted to
start fresh... so I kinda translated the documentation, but that is
irrelevant to the case.

Thanks,
Alex


On Mon, Aug 18, 2014 at 10:59 PM, Eric Redmond  wrote:

> Your steps seemed to have named the index "famoso".
>
> Eric
>
>
> On Aug 18, 2014, at 1:56 PM, Alex De la rosa 
> wrote:
>
> Ok, I found the first error in the documentation, parameters are in
> reverse order:
>
> bucket = client.bucket('animals', 'cats')
>
> should be:
>
> bucket = client.bucket('cats', 'animals')
>
> Now I could save and it found the bucket type: bucket =
> client.bucket('fcb','futbolistas') VS bucket = client.bucket('futbolistas',
> 'fcb')
>
> However, even fixing that, the next step fails as it was failing before:
>
>               
>         
> PYTHON:
>   bucket = client.bucket('fcb','futbolistas')
>   results = bucket.search('name_s:Lion*')
>   print results
>               
>         
> Traceback (most recent call last):
>   File "x.py", line 13, in 
> results = bucket.search('name_s:Lion*')
>   File "/usr/local/lib/python2.7/dist-packages/riak/bucket.py", line 420,
> in search
> return self._client.fulltext_search(self.name, query, **params)
>   File "/usr/local/lib/python2.7/dist-packages/riak/client/transport.py",
> line 184, in wrapper
> return self._with_retries(pool, thunk)
>   File "/usr/local/lib/python2.7/dist-packages/riak/client/transport.py",
> line 126, in _with_retries
> return fn(transport)
>   File "/usr/local/lib/python2.7/dist-packages/riak/client/transport.py",
> line 182, in thunk
> return fn(self, transport, *args, **kwargs)
>   File "/usr/local/lib/python2.7/dist-packages/riak/client/operations.py",
> line 573, in fulltext_search
> return transport.search(index, query, **params)
>   File
> "/usr/local/lib/python2.7/dist-packages/riak/transports/pbc/transport.py",
> line 564, in search
> MSG_CODE_SEARCH_QUERY_RESP)
>   File
> "/usr/local/lib/python2.7/dist-packages/riak/transports/pbc/connection.py",
> line 50, in _request
> return self._recv_msg(expect)
>   File
> "/usr/local/lib/python2.7/dist-packages/riak/transports/pbc/connection.py",
> line 142, in _recv_msg
> raise RiakError(err.errmsg)
> riak.RiakError: 'No index <<"fcb">> found.'
>
> Again it says "fcb" index not found... and this time I fully followed the
> right documentation and didn't use "bucket.enable_search()"
>
> Thanks,
> Alex
>
>
> On Mon, Aug 18, 2014 at 10:49 PM, Alex De la rosa  > wrote:
>
>> Hi Eric,
>>
>> I'm sorry but I followed the documentation that you provided me and still
>> raises issues:
>>
>>              
>>          
>> STEP 1: Create Index: famoso
>>              
>>          
>> PYTHON:
>>   client.create_search_index('famoso')
>>
>>              
>>          
>> STEP 2: Create Bucket Type: futbolistas
>>              
>>          
>> SHELL:
>>   riak-admin bucket-type create futbolistas
>> '{"props":{"search_index":"famoso"}}'
>>   => futbolistas created
>>   riak-admin bucket-type activate futbolistas
>>   => futbolistas has been activated
>>
>>              
>>          
>> STEP 3: Create Bucket and Add data: fcb
>>              
>>          
>> PYTHON:
>>   bucket = client.bucket('futbolistas', 'fcb')
>>   c = bucket.new('lionel', {'name_s': 'Lionel', 'age_i': 30, 'leader_b':
>> True})
>>   c.store()
>>
>> 

Re: Riak Search Issue

2014-08-18 Thread Alex De la rosa
Hi Eric,

I'm sorry but I followed the documentation that you provided me and still
raises issues:

              
        
STEP 1: Create Index: famoso
              
        
PYTHON:
  client.create_search_index('famoso')

              
        
STEP 2: Create Bucket Type: futbolistas
              
        
SHELL:
  riak-admin bucket-type create futbolistas
'{"props":{"search_index":"famoso"}}'
  => futbolistas created
  riak-admin bucket-type activate futbolistas
  => futbolistas has been activated

              
        
STEP 3: Create Bucket and Add data: fcb
              
        
PYTHON:
  bucket = client.bucket('futbolistas', 'fcb')
  c = bucket.new('lionel', {'name_s': 'Lionel', 'age_i': 30, 'leader_b':
True})
  c.store()

              
        
ERROR: This time it doesn't even let me save data into Riak
              
        
Traceback (most recent call last):
  File "x.py", line 10, in 
c = bucket.new('lionel', {'name_s': 'Lionel', 'age_i': 30, 'leader_b':
True})
  File "/usr/local/lib/python2.7/dist-packages/riak/bucket.py", line 159,
in new
if self.bucket_type.datatype:
  File "/usr/local/lib/python2.7/dist-packages/riak/util.py", line 78, in
__get__
value = self.fget(obj)
  File "/usr/local/lib/python2.7/dist-packages/riak/bucket.py", line 618,
in datatype
return self.get_properties().get('datatype')
  File "/usr/local/lib/python2.7/dist-packages/riak/bucket.py", line 557,
in get_properties
return self._client.get_bucket_type_props(self)
  File "/usr/local/lib/python2.7/dist-packages/riak/client/transport.py",
line 184, in wrapper
return self._with_retries(pool, thunk)
  File "/usr/local/lib/python2.7/dist-packages/riak/client/transport.py",
line 126, in _with_retries
return fn(transport)
  File "/usr/local/lib/python2.7/dist-packages/riak/client/transport.py",
line 182, in thunk
return fn(self, transport, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/riak/client/operations.py",
line 265, in get_bucket_type_props
return transport.get_bucket_type_props(bucket_type)
  File
"/usr/local/lib/python2.7/dist-packages/riak/transports/pbc/transport.py",
line 381, in get_bucket_type_props
MSG_CODE_GET_BUCKET_RESP)
  File
"/usr/local/lib/python2.7/dist-packages/riak/transports/pbc/connection.py",
line 50, in _request
return self._recv_msg(expect)
  File
"/usr/local/lib/python2.7/dist-packages/riak/transports/pbc/connection.py",
line 142, in _recv_msg
raise RiakError(err.errmsg)
riak.RiakError: 'Invalid bucket type: <<"fcb">>'

How to solve that? Is step by step the documentation provided.

Thanks,
Alex


On Mon, Aug 18, 2014 at 10:05 PM, Eric Redmond  wrote:

> The correct way to set up and use search is in the documentation. Be wary
> of any external sources, as they may be referring to Riak Search prior to
> 2.0.
>
> http://docs.basho.com/riak/2.0.0/dev/using/search/
>
> Eric
>
>
> On Aug 18, 2014, at 12:41 PM, Alex De la rosa 
> wrote:
>
> Hi Eric,
>
> I see! Understood, could you provide a little full example on how it
> should work? Because I think I also tried without it and failed.
>
> Luke told me to try using the GIT version one see if is a bug that was
> already fixed there.
>
> Thanks,
> Alex
>
> On Monday, August 18, 2014, Eric Redmond  wrote:
>
>> Alex,
>>
>> Don't call enable_search(). That enables *old* Riak Search (it sets the
>> property "search":true). To revert that setting, 
>> bucket.set_property("search",
>> False)
>>
>>
>>
>> On Aug 18, 2014, at 10:55 AM, Alex De la rosa 
>> wrote:
>>
>> Hi Luke,
>>
>>

Re: Riak Search Issue

2014-08-18 Thread Alex De la rosa
Hi Eric,

I will try this suggestion, also I will try Luke's suggestion on using
GIT's latest version instead of PIP to see if is something already fixed.

Once done that, I will tell you guys if is really a bug or if it was fixed
already on GIT cloning.

Thanks,
Alex


On Mon, Aug 18, 2014 at 11:10 PM, Eric Redmond  wrote:

> Alex,
>
> You may have discovered a legitimate bug in the python driver. In the
> meantime, if you give your bucket and index the same name, you can proceed,
> while we investigate.
>
> Thanks,
> Eric
>
>
> On Aug 18, 2014, at 2:00 PM, Alex De la rosa 
> wrote:
>
> Yes, I did it in purpose, because I did so many testings that I wanted to
> start fresh... so I kinda translated the documentation, but that is
> irrelevant to the case.
>
> Thanks,
> Alex
>
>
> On Mon, Aug 18, 2014 at 10:59 PM, Eric Redmond  wrote:
>
>> Your steps seemed to have named the index "famoso".
>>
>> Eric
>>
>>
>> On Aug 18, 2014, at 1:56 PM, Alex De la rosa 
>> wrote:
>>
>> Ok, I found the first error in the documentation, parameters are in
>> reverse order:
>>
>> bucket = client.bucket('animals', 'cats')
>>
>> should be:
>>
>> bucket = client.bucket('cats', 'animals')
>>
>> Now I could save and it found the bucket type: bucket =
>> client.bucket('fcb','futbolistas') VS bucket = client.bucket('futbolistas',
>> 'fcb')
>>
>> However, even fixing that, the next step fails as it was failing before:
>>
>>              
>>          
>> PYTHON:
>>   bucket = client.bucket('fcb','futbolistas')
>>   results = bucket.search('name_s:Lion*')
>>   print results
>>              
>>          
>> Traceback (most recent call last):
>>   File "x.py", line 13, in 
>> results = bucket.search('name_s:Lion*')
>>   File "/usr/local/lib/python2.7/dist-packages/riak/bucket.py", line 420,
>> in search
>> return self._client.fulltext_search(self.name, query, **params)
>>   File "/usr/local/lib/python2.7/dist-packages/riak/client/transport.py",
>> line 184, in wrapper
>> return self._with_retries(pool, thunk)
>>   File "/usr/local/lib/python2.7/dist-packages/riak/client/transport.py",
>> line 126, in _with_retries
>> return fn(transport)
>>   File "/usr/local/lib/python2.7/dist-packages/riak/client/transport.py",
>> line 182, in thunk
>> return fn(self, transport, *args, **kwargs)
>>   File
>> "/usr/local/lib/python2.7/dist-packages/riak/client/operations.py", line
>> 573, in fulltext_search
>> return transport.search(index, query, **params)
>>   File
>> "/usr/local/lib/python2.7/dist-packages/riak/transports/pbc/transport.py",
>> line 564, in search
>> MSG_CODE_SEARCH_QUERY_RESP)
>>   File
>> "/usr/local/lib/python2.7/dist-packages/riak/transports/pbc/connection.py",
>> line 50, in _request
>> return self._recv_msg(expect)
>>   File
>> "/usr/local/lib/python2.7/dist-packages/riak/transports/pbc/connection.py",
>> line 142, in _recv_msg
>> raise RiakError(err.errmsg)
>> riak.RiakError: 'No index <<"fcb">> found.'
>>
>> Again it says "fcb" index not found... and this time I fully followed the
>> right documentation and didn't use "bucket.enable_search()"
>>
>> Thanks,
>> Alex
>>
>>
>> On Mon, Aug 18, 2014 at 10:49 PM, Alex De la rosa <
>> alex.rosa@gmail.com> wrote:
>>
>>> Hi Eric,
>>>
>>> I'm sorry but I followed the documentation that you provided me and
>>> still raises issues:
>>>
>>>              
>>>          
>>> STEP 1: Create Index: famoso
>>>              
>>>          
>>> PYTHON:
>>>   client.create_search_index('famoso')
>>>
>>>        --

Re: Riak Search Issue

2014-08-18 Thread Alex De la rosa
Hi Eric,

Cool! This new syntax really worked :) even on different bucket names :) It
has been driving me crazy all day... haha, glad is finally sorted out.

PYTHON:
results = client.fulltext_search('famoso', 'name_s:Lio*')
print results

OUTPUT:
{'num_found': 2, 'max_score': 1.0, 'docs': [{u'age_i': u'30', u'name_s':
u'Lionel', u'_yz_rk': u'lionel', u'_yz_rb': u'fcb', u'score':
u'1.e+00', u'leader_b': u'true', u'_yz_id':
u'1*futbolistas*fcb*lionel*59', u'_yz_rt': u'futbolistas'}, {u'age_i':
u'30', u'name_s': u'Lionel', u'_yz_rk': u'lionel', u'_yz_rb': u'famoso',
u'score': u'1.e+00', u'leader_b': u'true', u'_yz_id':
u'1*futbolistas*famoso*lionel*8', u'_yz_rt': u'futbolistas'}]}

Thanks!
Alex


On Mon, Aug 18, 2014 at 11:33 PM, Eric Redmond  wrote:

> Alex,
>
> I was mistaken about the bucket search. The documentation is wrong, and
> the API is weirded for backward compatibility reasons. You should be able
> to search by index name this way.
>
> client.fulltext_search(index, query, **params)
>
> We'll update the docs to match.
>
> Eric
>
>
> On Aug 18, 2014, at 2:29 PM, Alex De la rosa 
> wrote:
>
> Hi Sean,
>
> Yeah, I opted to follow that pattern on my latest attempt as I see it more
> clear that the way in the documentation. Still same issue although with
> Eric we saw it works fine when index and bucket has the same name.
>
> Thanks!
> Alex
>
>
> On Mon, Aug 18, 2014 at 11:27 PM, Sean Cribbs  wrote:
>
>> Don't use bucket with 2 arguments, use
>> client.bucket_type('futbolistas').bucket('fcb'). This makes your
>> intent more clear. The 2-arity version of bucket() was for
>> backwards-compatibility.
>
>
>
>
___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


Riak Search VS other query systems

2014-08-18 Thread Alex De la rosa
Hi there,

I had been seeing lately Riak Search as an ultimate way to query Riak...
and it seems recommended to use over MapReduce and even 2i... said so...
should we try to always use Riak Search over the other systems?

Is there any situation in which MapReduce could be a better approach than
Riak Search?

Same goes for 2i... I believe 2i is an optimal approach if you just want
keys and know very well what are you looking for, but out of that, should
Riak Search try to replace all 2i uses?

Practical example: If you are twitter and want to get twits for the hashtag
#Riak, what would be the best approach? 2i? Riak Search? MapReduce?

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


Re: Riak Search Issue

2014-08-19 Thread Alex De la rosa
Hi Eric,

You were right on naming the bucket the same as the index... it worked that
way:

bucket = client.bucket_type('futbolistas').bucket('famoso')
results = bucket.search('name_s:Lion*')
print results

{'num_found': 2, 'max_score': 1.0, 'docs': [{u'age_i': u'30', u'name_s':
u'Lionel', u'_yz_rk': u'lionel', u'_yz_rb': u'fcb', u'score':
u'1.e+00', u'leader_b': u'true', u'_yz_id':
u'1*futbolistas*fcb*lionel*59', u'_yz_rt': u'futbolistas'}, {u'age_i':
u'30', u'name_s': u'Lionel', u'_yz_rk': u'lionel', u'_yz_rb': u'famoso',
u'score': u'1.e+00', u'leader_b': u'true', u'_yz_id':
u'1*futbolistas*famoso*lionel*8', u'_yz_rt': u'futbolistas'}]}

Later will check to install GIT's version and see if it works with a
different bucket name.

Thanks.
Alex


On Mon, Aug 18, 2014 at 11:12 PM, Alex De la rosa 
wrote:

> Hi Eric,
>
> I will try this suggestion, also I will try Luke's suggestion on using
> GIT's latest version instead of PIP to see if is something already fixed.
>
> Once done that, I will tell you guys if is really a bug or if it was fixed
> already on GIT cloning.
>
> Thanks,
> Alex
>
>
> On Mon, Aug 18, 2014 at 11:10 PM, Eric Redmond  wrote:
>
>> Alex,
>>
>> You may have discovered a legitimate bug in the python driver. In the
>> meantime, if you give your bucket and index the same name, you can proceed,
>> while we investigate.
>>
>> Thanks,
>> Eric
>>
>>
>> On Aug 18, 2014, at 2:00 PM, Alex De la rosa 
>> wrote:
>>
>> Yes, I did it in purpose, because I did so many testings that I wanted to
>> start fresh... so I kinda translated the documentation, but that is
>> irrelevant to the case.
>>
>> Thanks,
>> Alex
>>
>>
>> On Mon, Aug 18, 2014 at 10:59 PM, Eric Redmond 
>> wrote:
>>
>>> Your steps seemed to have named the index "famoso".
>>>
>>> Eric
>>>
>>>
>>> On Aug 18, 2014, at 1:56 PM, Alex De la rosa 
>>> wrote:
>>>
>>> Ok, I found the first error in the documentation, parameters are in
>>> reverse order:
>>>
>>> bucket = client.bucket('animals', 'cats')
>>>
>>> should be:
>>>
>>> bucket = client.bucket('cats', 'animals')
>>>
>>> Now I could save and it found the bucket type: bucket =
>>> client.bucket('fcb','futbolistas') VS bucket = client.bucket('futbolistas',
>>> 'fcb')
>>>
>>> However, even fixing that, the next step fails as it was failing before:
>>>
>>>              
>>>          
>>> PYTHON:
>>>   bucket = client.bucket('fcb','futbolistas')
>>>   results = bucket.search('name_s:Lion*')
>>>   print results
>>>              
>>>          
>>> Traceback (most recent call last):
>>>   File "x.py", line 13, in 
>>> results = bucket.search('name_s:Lion*')
>>>   File "/usr/local/lib/python2.7/dist-packages/riak/bucket.py", line
>>> 420, in search
>>> return self._client.fulltext_search(self.name, query, **params)
>>>   File
>>> "/usr/local/lib/python2.7/dist-packages/riak/client/transport.py", line
>>> 184, in wrapper
>>> return self._with_retries(pool, thunk)
>>>   File
>>> "/usr/local/lib/python2.7/dist-packages/riak/client/transport.py", line
>>> 126, in _with_retries
>>> return fn(transport)
>>>   File
>>> "/usr/local/lib/python2.7/dist-packages/riak/client/transport.py", line
>>> 182, in thunk
>>> return fn(self, transport, *args, **kwargs)
>>>   File
>>> "/usr/local/lib/python2.7/dist-packages/riak/client/operations.py", line
>>> 573, in fulltext_search
>>> return transport.search(index, query, **params)
>

Re: Riak Search Issue

2014-08-19 Thread Alex De la rosa
Hi Sean,

Yeah, I opted to follow that pattern on my latest attempt as I see it more
clear that the way in the documentation. Still same issue although with
Eric we saw it works fine when index and bucket has the same name.

Thanks!
Alex


On Mon, Aug 18, 2014 at 11:27 PM, Sean Cribbs  wrote:

> Don't use bucket with 2 arguments, use
> client.bucket_type('futbolistas').bucket('fcb'). This makes your
> intent more clear. The 2-arity version of bucket() was for
> backwards-compatibility.
>
> On Mon, Aug 18, 2014 at 4:10 PM, Eric Redmond  wrote:
> > Alex,
> >
> > You may have discovered a legitimate bug in the python driver. In the
> > meantime, if you give your bucket and index the same name, you can
> proceed,
> > while we investigate.
> >
> > Thanks,
> > Eric
> >
> >
> > On Aug 18, 2014, at 2:00 PM, Alex De la rosa 
> > wrote:
> >
> > Yes, I did it in purpose, because I did so many testings that I wanted to
> > start fresh... so I kinda translated the documentation, but that is
> > irrelevant to the case.
> >
> > Thanks,
> > Alex
> >
> >
> > On Mon, Aug 18, 2014 at 10:59 PM, Eric Redmond 
> wrote:
> >>
> >> Your steps seemed to have named the index "famoso".
> >>
> >> Eric
> >>
> >>
> >> On Aug 18, 2014, at 1:56 PM, Alex De la rosa 
> >> wrote:
> >>
> >> Ok, I found the first error in the documentation, parameters are in
> >> reverse order:
> >>
> >> bucket = client.bucket('animals', 'cats')
> >>
> >> should be:
> >>
> >> bucket = client.bucket('cats', 'animals')
> >>
> >> Now I could save and it found the bucket type: bucket =
> >> client.bucket('fcb','futbolistas') VS bucket =
> client.bucket('futbolistas',
> >> 'fcb')
> >>
> >> However, even fixing that, the next step fails as it was failing before:
> >>
> >>              
> 
> >>         
> >> PYTHON:
> >>   bucket = client.bucket('fcb','futbolistas')
> >>   results = bucket.search('name_s:Lion*')
> >>   print results
> >>              
> 
> >>         
> >> Traceback (most recent call last):
> >>   File "x.py", line 13, in 
> >> results = bucket.search('name_s:Lion*')
> >>   File "/usr/local/lib/python2.7/dist-packages/riak/bucket.py", line
> 420,
> >> in search
> >> return self._client.fulltext_search(self.name, query, **params)
> >>   File
> "/usr/local/lib/python2.7/dist-packages/riak/client/transport.py",
> >> line 184, in wrapper
> >> return self._with_retries(pool, thunk)
> >>   File
> "/usr/local/lib/python2.7/dist-packages/riak/client/transport.py",
> >> line 126, in _with_retries
> >> return fn(transport)
> >>   File
> "/usr/local/lib/python2.7/dist-packages/riak/client/transport.py",
> >> line 182, in thunk
> >> return fn(self, transport, *args, **kwargs)
> >>   File
> "/usr/local/lib/python2.7/dist-packages/riak/client/operations.py",
> >> line 573, in fulltext_search
> >> return transport.search(index, query, **params)
> >>   File
> >>
> "/usr/local/lib/python2.7/dist-packages/riak/transports/pbc/transport.py",
> >> line 564, in search
> >> MSG_CODE_SEARCH_QUERY_RESP)
> >>   File
> >>
> "/usr/local/lib/python2.7/dist-packages/riak/transports/pbc/connection.py",
> >> line 50, in _request
> >> return self._recv_msg(expect)
> >>   File
> >>
> "/usr/local/lib/python2.7/dist-packages/riak/transports/pbc/connection.py",
> >> line 142, in _recv_msg
> >> raise RiakError(err.errmsg)
> >> riak.RiakError: 'No index <<"fcb">> found.'
> >>
> >> Again it says "fcb" index not found... and this time I fully followed
> the
> >> right documentation and didn't use "bucket.enable_search()"
> >>
> >> Thanks,
> >> Alex
>

Re: Riak python client and Solr

2014-08-19 Thread Alex De la rosa
Hi there,

I was having the same problems too...

this works fine:
r = client.fulltext_search('ix_images', 'site_s:xxx AND keywords_s:yyy')

but this gives the same error as yours:
r = client.fulltext_search('ix_images', 'site_s:xxx AND
keywords_s:yyy&sort="clickrate_f desc"')

Then I saw this way works:
r = client.fulltext_search('ix_images', 'site_s:xxx AND keywords_s:yyy
SORT:"clickrate_f desc"')

So try chaining parameters with semicolons.

Thanks!
Alex


On Tue, Aug 19, 2014 at 10:08 PM, Sapre, Meghna A 
wrote:

>  Hi,
>
>   I am trying to use the group and stats options with riak search. I get
> expected results with http urls, but not with python-riak-client fulltext
> pbc search.
>
> Here’s what I’m trying to do:
>
>
>
> q = 'build.type:CI&group=on&group.field=build.version'
>
> try:
>
> search_results =
> riak_client.fulltext_search(self.Result_Index, q)
>
>except Exception as e:
>
> print e
>
> log.exception(e)
>
>
>
> This throws an error: no field name specified in query and no default
> specified via 'df' param.
>
>
>
> The same query string works without the group options, and the complete
> string works in the http API.
>
> Any suggestions on how to make this work?
>
>
>
> Thanks,
>
> Meghna
>
>
>
> ___
> 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: Riak python client and Solr

2014-08-19 Thread Alex De la rosa
Seems I was wrong... the API doesn't complain but it doesn't perform the
sorting as I thought it should do... any clues on how to do it?

this:
r = client.fulltext_search('ix_images', 'site_s:xxx AND keywords_s:yyy')

plus sorting by "clickrate_f desc"

Thanks!
Alex


On Tue, Aug 19, 2014 at 10:13 PM, Alex De la rosa 
wrote:

> Hi there,
>
> I was having the same problems too...
>
> this works fine:
> r = client.fulltext_search('ix_images', 'site_s:xxx AND keywords_s:yyy')
>
> but this gives the same error as yours:
> r = client.fulltext_search('ix_images', 'site_s:xxx AND
> keywords_s:yyy&sort="clickrate_f desc"')
>
> Then I saw this way works:
> r = client.fulltext_search('ix_images', 'site_s:xxx AND keywords_s:yyy
> SORT:"clickrate_f desc"')
>
> So try chaining parameters with semicolons.
>
> Thanks!
> Alex
>
>
> On Tue, Aug 19, 2014 at 10:08 PM, Sapre, Meghna A <
> meghna.a.sa...@intel.com> wrote:
>
>>  Hi,
>>
>>   I am trying to use the group and stats options with riak search. I get
>> expected results with http urls, but not with python-riak-client fulltext
>> pbc search.
>>
>> Here’s what I’m trying to do:
>>
>>
>>
>> q = 'build.type:CI&group=on&group.field=build.version'
>>
>> try:
>>
>> search_results =
>> riak_client.fulltext_search(self.Result_Index, q)
>>
>>except Exception as e:
>>
>> print e
>>
>> log.exception(e)
>>
>>
>>
>> This throws an error: no field name specified in query and no default
>> specified via 'df' param.
>>
>>
>>
>> The same query string works without the group options, and the complete
>> string works in the http API.
>>
>> Any suggestions on how to make this work?
>>
>>
>>
>> Thanks,
>>
>> Meghna
>>
>>
>>
>> ___
>> 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: Riak python client and Solr

2014-08-19 Thread Alex De la rosa
Ok, now I saw Sean's response... it worked perfectly that way :)

r = client.fulltext_search('ix_images', 'site_s:aaa AND keywords_s:bbb',
sort='clickrate_f asc')

Thanks!
Alex


On Tue, Aug 19, 2014 at 10:17 PM, Alex De la rosa 
wrote:

> Seems I was wrong... the API doesn't complain but it doesn't perform the
> sorting as I thought it should do... any clues on how to do it?
>
> this:
> r = client.fulltext_search('ix_images', 'site_s:xxx AND keywords_s:yyy')
>
> plus sorting by "clickrate_f desc"
>
> Thanks!
> Alex
>
>
> On Tue, Aug 19, 2014 at 10:13 PM, Alex De la rosa  > wrote:
>
>> Hi there,
>>
>> I was having the same problems too...
>>
>> this works fine:
>> r = client.fulltext_search('ix_images', 'site_s:xxx AND keywords_s:yyy')
>>
>> but this gives the same error as yours:
>> r = client.fulltext_search('ix_images', 'site_s:xxx AND
>> keywords_s:yyy&sort="clickrate_f desc"')
>>
>> Then I saw this way works:
>> r = client.fulltext_search('ix_images', 'site_s:xxx AND keywords_s:yyy
>> SORT:"clickrate_f desc"')
>>
>> So try chaining parameters with semicolons.
>>
>> Thanks!
>> Alex
>>
>>
>> On Tue, Aug 19, 2014 at 10:08 PM, Sapre, Meghna A <
>> meghna.a.sa...@intel.com> wrote:
>>
>>>  Hi,
>>>
>>>   I am trying to use the group and stats options with riak search. I get
>>> expected results with http urls, but not with python-riak-client fulltext
>>> pbc search.
>>>
>>> Here’s what I’m trying to do:
>>>
>>>
>>>
>>> q = 'build.type:CI&group=on&group.field=build.version'
>>>
>>> try:
>>>
>>> search_results =
>>> riak_client.fulltext_search(self.Result_Index, q)
>>>
>>>except Exception as e:
>>>
>>> print e
>>>
>>> log.exception(e)
>>>
>>>
>>>
>>> This throws an error: no field name specified in query and no default
>>> specified via 'df' param.
>>>
>>>
>>>
>>> The same query string works without the group options, and the complete
>>> string works in the http API.
>>>
>>> Any suggestions on how to make this work?
>>>
>>>
>>>
>>> Thanks,
>>>
>>> Meghna
>>>
>>>
>>>
>>> ___
>>> 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


Counters inside Maps

2014-08-19 Thread Alex De la rosa
Imagine I have a Riak object "footballer" with some static fields: name,
team, number. I store them like this now:

1: CREATE INDEX FOR RIAK SEARCH
curl -XPUT "http://148.251.140.229:8098/search/index/ix_footballers";

2: CREATE BUCKET TYPE
riak-admin bucket-type create tp_footballers
'{"props":{"allow_mult":false,"search_index":"ix_footballers"}}'
riak-admin bucket-type activate tp_footballers

3: INSERT A PLAYER
bucket = client.bucket_type('tp_footballers').bucket('footballers')
key = bucket.new('lionelmessi', data={'name_s':'Messi',
'team_s':'Barcelona', 'number_i':10}, content_type='application/json')
key.store()

4: SEARCH FOR BARCELONA PLAYERS
r = client.fulltext_search('ix_footballers', 'team_s:Barcelona')

So far so good :) BUT... what if I want to have a field "goals_i" that is a
counter that will be incremented each match day with the number of goals he
scored? What is the syntax/steps to do to set up "footballers" as a MAP and
then put a COUNTER inside? I know is possible as I read it in some data
dump some Basho employee passed me some time ago, but I can't manage to see
how to do it now.

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


Re: Counters inside Maps

2014-08-19 Thread Alex De la rosa
Hi Sean,

I didn't created the bucket_type as a map datatype as at first i was just
testing simple Riak Search... then it occurred to me what if I want a
counter in the data? :)

Your example is pretty straightforward to follow and simple. Just 2
questions:

1. key.counters['number'].increment(1) => No need to define a "counters"
data-type somewhere before putting it inside the map as we normally need in
simple buckets? If it works automatically is great :)

2. if we use "number_counter" instead of "number_i" does Search/SOLR
understand is an integer? in case you want to do a range... as somewhere in
the docs I read that better to use "_s" for strings, "_b" for binary, "_i"
for integers, etc... so SOLR knows how to treat the data... I believe there
will be no strange behaviours for having "_register" instead of "_s" and
"_counter" instead of "_i", right?

Thanks!
Alex


On Wed, Aug 20, 2014 at 12:24 AM, Sean Cribbs  wrote:

> Alex,
>
> Assuming you've already made your bucket-type with "map" as the
> datatype, then "bucket.new()" will return you a Map instead of a
> RiakObject. Translating your example above:
>
> key = bucket.new('lionelmessi')
> key.registers['name'].assign('Messi')
> key.registers['team'].assign('Barcelona')
> key.counters['number'].increment(10)
> key.store()
>
> Note that because Maps are based on mutation operations and not
> replacing the value with new ones, you can later do this without
> setting the entire value:
>
> key.counters['number'].increment(1)
> key.store()
>
> This will also change your searches, however, in that the fields will
> be suffixed with the embedded type you are using:
>
> r = client.fulltext_search('ix_footballers', 'team_register:Barcelona')
>
> Hope that helps!
>
> On Tue, Aug 19, 2014 at 2:59 PM, Alex De la rosa
>  wrote:
> > Imagine I have a Riak object "footballer" with some static fields: name,
> > team, number. I store them like this now:
> >
> > 1: CREATE INDEX FOR RIAK SEARCH
> > curl -XPUT "http://148.251.140.229:8098/search/index/ix_footballers";
> >
> > 2: CREATE BUCKET TYPE
> > riak-admin bucket-type create tp_footballers
> > '{"props":{"allow_mult":false,"search_index":"ix_footballers"}}'
> > riak-admin bucket-type activate tp_footballers
> >
> > 3: INSERT A PLAYER
> > bucket = client.bucket_type('tp_footballers').bucket('footballers')
> > key = bucket.new('lionelmessi', data={'name_s':'Messi',
> > 'team_s':'Barcelona', 'number_i':10}, content_type='application/json')
> > key.store()
> >
> > 4: SEARCH FOR BARCELONA PLAYERS
> > r = client.fulltext_search('ix_footballers', 'team_s:Barcelona')
> >
> > So far so good :) BUT... what if I want to have a field "goals_i" that
> is a
> > counter that will be incremented each match day with the number of goals
> he
> > scored? What is the syntax/steps to do to set up "footballers" as a MAP
> and
> > then put a COUNTER inside? I know is possible as I read it in some data
> dump
> > some Basho employee passed me some time ago, but I can't manage to see
> how
> > to do it now.
> >
> > Thanks!
> > Alex
> >
> > ___
> > riak-users mailing list
> > riak-users@lists.basho.com
> > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
> >
>
>
>
> --
> Sean Cribbs 
> Software Engineer
> Basho Technologies, Inc.
> http://basho.com/
>
___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


Re: Counters inside Maps

2014-08-19 Thread Alex De la rosa
Hi Luc,

Thanks for your link to the documentation; that was exactly what I saw on
the data dump some time ago, didn't know it was published there :)

Just one question regarding your example in contrast with Sean's...

x.registers['name'].assign('Messi')
x.registers['name_s'].assign('Messi')

You added "_s" to the field while Sean removed it and said it will be
"name_register" automatically... in your case would turn into
"name_s_register" I supposed, right?

Thanks!
Alex


On Wed, Aug 20, 2014 at 12:27 AM, Luc Perkins  wrote:

> Alex,
>
> Do you mean a map as in a Python dict or as in a Riak map? If you want to
> create *footballers* as a Riak map, skip to the *Maps* section in this doc
> <http://docs.basho.com/riak/2.0.0/dev/using/data-types/#Maps>. That
> provides a full tutorial for dealing with other Data Types, such as
> counters, within maps, and has Python code samples.
>
> If you're storing Python dicts as JSON in Riak, as in your example, you
> will have to GET the map from Riak and manipulate it client side. So if you
> wanted to add a *goals_i* counter that starts at 0, you'd have to do
> something like this:
>
> *obj = bucket.get('lionelmessi')*
> *obj.data['goals_i'] = 0*
> *obj.store()*
>
> To increment the counter, you could do so in a function like this:
>
> *def increment(bucket, key, n):*
> *obj = bucket.get(key)*
> *obj['goals_i'] = obj['goals_i'] + n*
> *obj.store()*
>
> That's of course a very rough example. But you can probably see from this
> example that using Riak maps can be a very nice option if you're using a
> data model that fits. Here's an example of storing your *lionelmessi* object
> as a Riak map:
>
> *riak-admin bucket-type create maps '{"props":{"datatype":"map"}}'*
> *riak-admin bucket-type activate maps*
>
> *from riak.datatypes import Map*
>
> *bucket = client.bucket_type('maps').bucket('footballers')*
> *messi_map = Map(bucket, 'lionelmessi')*
> *messi_map.registers['name_s'].assign('Messi')*
> *messi_map.registers['team_s'].assign('Barcelona')*
> *messi_map.registers['number_i'].assign(str(10))*
> *messi_map.counters['goals_i'].increment()*
> *messi_map.store()*
>
> Luc
>
>
> On Tue, Aug 19, 2014 at 2:59 PM, Alex De la rosa 
> wrote:
>
>> Imagine I have a Riak object "footballer" with some static fields: name,
>> team, number. I store them like this now:
>>
>> 1: CREATE INDEX FOR RIAK SEARCH
>> curl -XPUT "http://148.251.140.229:8098/search/index/ix_footballers";
>>
>> 2: CREATE BUCKET TYPE
>> riak-admin bucket-type create tp_footballers
>> '{"props":{"allow_mult":false,"search_index":"ix_footballers"}}'
>> riak-admin bucket-type activate tp_footballers
>>
>> 3: INSERT A PLAYER
>> bucket = client.bucket_type('tp_footballers').bucket('footballers')
>> key = bucket.new('lionelmessi', data={'name_s':'Messi',
>> 'team_s':'Barcelona', 'number_i':10}, content_type='application/json')
>> key.store()
>>
>> 4: SEARCH FOR BARCELONA PLAYERS
>> r = client.fulltext_search('ix_footballers', 'team_s:Barcelona')
>>
>> So far so good :) BUT... what if I want to have a field "goals_i" that is
>> a counter that will be incremented each match day with the number of goals
>> he scored? What is the syntax/steps to do to set up "footballers" as a MAP
>> and then put a COUNTER inside? I know is possible as I read it in some data
>> dump some Basho employee passed me some time ago, but I can't manage to see
>> how to do it now.
>>
>> Thanks!
>> Alex
>>
>> ___
>> 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: Counters inside Maps

2014-08-19 Thread Alex De la rosa
Cool! Understood :)

Thanks!
Alex

On Wednesday, August 20, 2014, Sean Cribbs  wrote:

> On Tue, Aug 19, 2014 at 3:34 PM, Alex De la rosa
> > wrote:
> > Hi Sean,
> >
> > I didn't created the bucket_type as a map datatype as at first i was just
> > testing simple Riak Search... then it occurred to me what if I want a
> > counter in the data? :)
> >
> > Your example is pretty straightforward to follow and simple. Just 2
> > questions:
> >
> > 1. key.counters['number'].increment(1) => No need to define a "counters"
> > data-type somewhere before putting it inside the map as we normally need
> in
> > simple buckets? If it works automatically is great :)
>
> Yes, it works automatically. All included datatypes are available inside
> maps.
>
> >
> > 2. if we use "number_counter" instead of "number_i" does Search/SOLR
> > understand is an integer? in case you want to do a range... as somewhere
> in
> > the docs I read that better to use "_s" for strings, "_b" for binary,
> "_i"
> > for integers, etc... so SOLR knows how to treat the data... I believe
> there
> > will be no strange behaviours for having "_register" instead of "_s" and
> > "_counter" instead of "_i", right?
>
> The default Solr schema that ships with Riak accounts for these
> datatypes automatically and uses the appropriate index field type:
>
> https://github.com/basho/yokozuna/blob/develop/priv/default_schema.xml#L96-L104
>
> If you write your own schema, you will want to include or change the
> schema fields appropriately.
>
> >
> > Thanks!
> > Alex
> >
> >
> > On Wed, Aug 20, 2014 at 12:24 AM, Sean Cribbs  > wrote:
> >>
> >> Alex,
> >>
> >> Assuming you've already made your bucket-type with "map" as the
> >> datatype, then "bucket.new()" will return you a Map instead of a
> >> RiakObject. Translating your example above:
> >>
> >> key = bucket.new('lionelmessi')
> >> key.registers['name'].assign('Messi')
> >> key.registers['team'].assign('Barcelona')
> >> key.counters['number'].increment(10)
> >> key.store()
> >>
> >> Note that because Maps are based on mutation operations and not
> >> replacing the value with new ones, you can later do this without
> >> setting the entire value:
> >>
> >> key.counters['number'].increment(1)
> >> key.store()
> >>
> >> This will also change your searches, however, in that the fields will
> >> be suffixed with the embedded type you are using:
> >>
> >> r = client.fulltext_search('ix_footballers', 'team_register:Barcelona')
> >>
> >> Hope that helps!
> >>
> >> On Tue, Aug 19, 2014 at 2:59 PM, Alex De la rosa
> >> > wrote:
> >> > Imagine I have a Riak object "footballer" with some static fields:
> name,
> >> > team, number. I store them like this now:
> >> >
> >> > 1: CREATE INDEX FOR RIAK SEARCH
> >> > curl -XPUT "http://148.251.140.229:8098/search/index/ix_footballers";
> >> >
> >> > 2: CREATE BUCKET TYPE
> >> > riak-admin bucket-type create tp_footballers
> >> > '{"props":{"allow_mult":false,"search_index":"ix_footballers"}}'
> >> > riak-admin bucket-type activate tp_footballers
> >> >
> >> > 3: INSERT A PLAYER
> >> > bucket = client.bucket_type('tp_footballers').bucket('footballers')
> >> > key = bucket.new('lionelmessi', data={'name_s':'Messi',
> >> > 'team_s':'Barcelona', 'number_i':10}, content_type='application/json')
> >> > key.store()
> >> >
> >> > 4: SEARCH FOR BARCELONA PLAYERS
> >> > r = client.fulltext_search('ix_footballers', 'team_s:Barcelona')
> >> >
> >> > So far so good :) BUT... what if I want to have a field "goals_i" that
> >> > is a
> >> > counter that will be incremented each match day with the number of
> goals
> >> > he
> >> > scored? What is the syntax/steps to do to set up "footballers" as a
> MAP
> >> > and
> >> > then put a COUNTER inside? I know is possible as I read it in some
> data
> >> > dump
> >> > some Basho employee passed me some time ago, but I can't manage to see
> >> > how
> >> > to do it now.
> >> >
> >> > Thanks!
> >> > Alex
> >> >
> >> > ___
> >> > riak-users mailing list
> >> > riak-users@lists.basho.com 
> >> > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
> >> >
> >>
> >>
> >>
> >> --
> >> Sean Cribbs >
> >> Software Engineer
> >> Basho Technologies, Inc.
> >> http://basho.com/
> >
> >
>
>
>
> --
> Sean Cribbs >
> Software Engineer
> Basho Technologies, Inc.
> http://basho.com/
>
___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


Re: Riak Search VS other query systems

2014-08-20 Thread Alex De la rosa
Any thoughts about this?

One thing it worries me about Riak Search is that if one index has several
millions of object to search for maybe it becomes slow? 2i might be faster
then?

Thanks!
Alex


On Tue, Aug 19, 2014 at 8:47 AM, Alex De la rosa 
wrote:

> Hi there,
>
> I had been seeing lately Riak Search as an ultimate way to query Riak...
> and it seems recommended to use over MapReduce and even 2i... said so...
> should we try to always use Riak Search over the other systems?
>
> Is there any situation in which MapReduce could be a better approach than
> Riak Search?
>
> Same goes for 2i... I believe 2i is an optimal approach if you just want
> keys and know very well what are you looking for, but out of that, should
> Riak Search try to replace all 2i uses?
>
> Practical example: If you are twitter and want to get twits for the
> hashtag #Riak, what would be the best approach? 2i? Riak Search? MapReduce?
>
> Thanks!
> Alex
>
___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


Riak Search on "Sets" data-types

2014-08-21 Thread Alex De la rosa
Hi there,

For a project I'm building I'm saving a "keyword" and a "site" for an image
like this:

  bucket = client.bucket_type('tp_images').bucket('images')
  key = bucket.new(image_hash)
  key.registers['raw'].assign(base64.b64encode(image_data))
  key.registers['site'].assign('johnlewis.com')
  key.registers['keywords'].assign('cameras')
  key.store()

and querying the index like this to get the desired images:

  r = client.fulltext_search('ix_images', 'site_registers:johnlewis.com AND
keywords_registers:cameras', sort='clicks_counter desc', rows=5)

Imagine now that i want to associate the same image to different keywords,
having a SET instead of a REGISTER:

  bucket = client.bucket_type('tp_images').bucket('images')
  key = bucket.new(image_hash)
  key.registers['raw'].assign(base64.b64encode(image_data))
  key.registers['site'].assign('johnlewis.com')
  key.sets['keywords'].add('digital cameras')
  key.sets['keywords'].add('DLSR')
  key.store()

How to query the SET using Riak Search? Something like the "IN ()"
statement in traditional SQL:

  r = client.fulltext_search('ix_images', 'site_registers:johnlewis.com AND
keywords_set:???', sort='clicks_counter desc', rows=5)

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


Avoid siblings in "data-type" bucket

2014-08-21 Thread Alex De la rosa
Hi there,

I was trying to create a bucket-type using the datatype MAP and it didn't
allow me to create it with "allow_mult":false:

# riak-admin bucket-type create tp_images
'{"props":{"allow_mult":false,"search_index":"ix_images","datatype":"map"}}'Error
creating bucket type tp_images:Data Type buckets must be allow_mult=true
How to avoid siblings in this bucket then?

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


Re: Avoid siblings in "data-type" bucket

2014-08-21 Thread Alex De la rosa
Cool, thank you very much

Alex


On Thu, Aug 21, 2014 at 9:18 PM, John Daily  wrote:

> Siblings are resolved automatically by Riak when using our data types,
> thus the requirement that allow_mult=true.
>
> -John
>
>
> On Thu, Aug 21, 2014 at 3:17 PM, Alex De la rosa 
> wrote:
>
>> Hi there,
>>
>> I was trying to create a bucket-type using the datatype MAP and it didn't
>> allow me to create it with "allow_mult":false:
>>
>> # riak-admin bucket-type create tp_images
>> '{"props":{"allow_mult":false,"search_index":"ix_images","datatype":"map"}}'Error
>> creating bucket type tp_images:Data Type buckets must be allow_mult=true
>> How to avoid siblings in this bucket then?
>>
>> Thanks,Alex
>>
>> ___
>> 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: Riak Search on "Sets" data-types

2014-08-22 Thread Alex De la rosa
Answering my own question, in case somebody has the same need some day,
seems that a SET works like a collection of REGISTERS and you can use it as
follows:

r = client.fulltext_search('ix_images', 'keywords_set:DLSR')

Thanks!
Alex

On Thu, Aug 21, 2014 at 8:32 PM, Alex De la rosa 
wrote:

> Hi there,
>
> For a project I'm building I'm saving a "keyword" and a "site" for an
> image like this:
>
>   bucket = client.bucket_type('tp_images').bucket('images')
>   key = bucket.new(image_hash)
>   key.registers['raw'].assign(base64.b64encode(image_data))
>   key.registers['site'].assign('johnlewis.com')
>   key.registers['keywords'].assign('cameras')
>   key.store()
>
> and querying the index like this to get the desired images:
>
>   r = client.fulltext_search('ix_images', 'site_registers:johnlewis.com AND
> keywords_registers:cameras', sort='clicks_counter desc', rows=5)
>
> Imagine now that i want to associate the same image to different keywords,
> having a SET instead of a REGISTER:
>
>   bucket = client.bucket_type('tp_images').bucket('images')
>   key = bucket.new(image_hash)
>   key.registers['raw'].assign(base64.b64encode(image_data))
>   key.registers['site'].assign('johnlewis.com')
>   key.sets['keywords'].add('digital cameras')
>   key.sets['keywords'].add('DLSR')
>   key.store()
>
> How to query the SET using Riak Search? Something like the "IN ()"
> statement in traditional SQL:
>
>   r = client.fulltext_search('ix_images', 'site_registers:johnlewis.com AND
> keywords_set:???', sort='clicks_counter desc', rows=5)
>
> Thanks!
> Alex
>
___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


Re: duplicate keys in Riak secondary index

2014-08-22 Thread Alex De la rosa
Might be siblings?

Thanks,
Alex


On Thu, Aug 21, 2014 at 10:29 PM, Chaim Peck  wrote:

> I am looking for some clues as to why there might be duplicate keys in a
> Riak Secondary Index. I am using version 1.4.0.
>
> Thanks,
> Chaim
> ___
> 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


Custom data-types

2014-08-28 Thread Alex De la rosa
Hi there,

Correct me if I'm wrong, but I think I read somewhere that custom
data-types can be created through schemas or something like that. So, apart
from COUNTERS, SETS and MAPS we could have some custom defined ones.

I would love to have a STACKS data-type that would work like a FIFO stack,
so I could save the last 100 objects for some action. Imagine we are
building Twitter where millions of tweets are sent all the time, but we
want to quickly know the last 100 tweets for a user. Imagine something like:

obj.stacks['last_tweets'].add(id_of_last_tweet)

IN: last_tweet ---> STACK_OF_100_TWEETS ---> OUT: older than the 100th goes
out

Is this possible? If so, how to do it?

Thanks and Best Regards,
Alex
___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


Re: Custom data-types

2014-08-29 Thread Alex De la rosa
Hi Sean,

Seems I was wrong, that makes total sense now that you exposed it, looked a
"too good" feature to me, but seems is not that easy.

By the way, how does "schemas" really work for Riak Search? I went back and
read the documentation but didn't see a real difference from using the
default schema.

Thanks!
Alex


On Fri, Aug 29, 2014 at 3:36 PM, Sean Cribbs  wrote:

> Alex,
>
> In short, no, you can't create custom types through schemas. Schemas
> currently only refer to Riak Search 2.
>
> We would love that too, but it hasn't happened yet. The problem is not
> conceiving of a data type but making its behavior both sensible and
> convergent in the face of concurrent activity or network partitions.
> For instance, say that two tweets come in around the same time. Who
> goes first in the "stack" you described? How can multiple independent
> copies reason about which ones to drop from the bottom of the stack to
> keep it bounded to 100? What happens if a replica is separated from
> the others for a while and has really stale entries, is it valid to
> serve those to a user? What happens when one replica pushes an element
> and another one pops it at the same time?
>
> These sound like they might be trivial problems, but they are
> incredibly hard to reason about in the general case. You have to
> reason about the ordering of events, the scope of their effects, and
> decide on a least-surprising behavior to expose to the user. Although
> we have given a pretty familiar/friendly interface to the data types
> shipping in 2.0, their behavior is strictly different from the types
> you would use in a single-threaded program in local memory.
>
> On Thu, Aug 28, 2014 at 4:47 PM, Alex De la rosa
>  wrote:
> > Hi there,
> >
> > Correct me if I'm wrong, but I think I read somewhere that custom
> data-types
> > can be created through schemas or something like that. So, apart from
> > COUNTERS, SETS and MAPS we could have some custom defined ones.
> >
> > I would love to have a STACKS data-type that would work like a FIFO
> stack,
> > so I could save the last 100 objects for some action. Imagine we are
> > building Twitter where millions of tweets are sent all the time, but we
> want
> > to quickly know the last 100 tweets for a user. Imagine something like:
> >
> > obj.stacks['last_tweets'].add(id_of_last_tweet)
> >
> > IN: last_tweet ---> STACK_OF_100_TWEETS ---> OUT: older than the 100th
> goes
> > out
> >
> > Is this possible? If so, how to do it?
> >
> > Thanks and Best Regards,
> > Alex
> >
> > ___
> > riak-users mailing list
> > riak-users@lists.basho.com
> > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
> >
>
>
>
> --
> Sean Cribbs 
> Software Engineer
> Basho Technologies, Inc.
> http://basho.com/
>
___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


Riak VS Graph Databases

2014-08-29 Thread Alex De la rosa
Hi there,

For some time already I have in mind building a kind of social network
myself. Is pretty ambitious project although it doesn't have in mind to be
a new facebook; but still data will be quite big and complex.

I like Riak and I had been following since version 0.14, and new additions
in Riak 2.0 seem to help a lot in how to model the data; although
relationships will be unavoidable.

Some friends suggested me to use Graph Databases instead. How would Riak
compare to Graph Databases for this use case? Is it doable to create a
social network entirely from Riak? Or may not be recommended?

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


Re: Riak VS Graph Databases

2014-08-29 Thread Alex De la rosa
Hi Guido,

This could be a solution; although I would try to do it in an homogeneous
system where only one NoSQL DB would be around if possible :)

Thanks!
Alex


On Fri, Aug 29, 2014 at 5:03 PM, Guido Medina 
wrote:

>  Maybe what you are looking for is a combination of both, say, your KV
> data in Riak with a combination of background processes able to build the
> necessary searching graphs in Neo4J, in such way your data is secure in a
> Riak cluster and searchable on several Neo4J servers.
>
> That's just an idea which might be not do-able, hope it helps,
>
> Guido.
>
>
> On 29/08/14 15:54, Alex De la rosa wrote:
>
> Hi there,
>
>  For some time already I have in mind building a kind of social network
> myself. Is pretty ambitious project although it doesn't have in mind to be
> a new facebook; but still data will be quite big and complex.
>
>  I like Riak and I had been following since version 0.14, and new
> additions in Riak 2.0 seem to help a lot in how to model the data; although
> relationships will be unavoidable.
>
>  Some friends suggested me to use Graph Databases instead. How would Riak
> compare to Graph Databases for this use case? Is it doable to create a
> social network entirely from Riak? Or may not be recommended?
>
>  Thanks!
> Alex
>
>
> ___
> riak-users mailing 
> listriak-users@lists.basho.comhttp://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: Riak VS Graph Databases

2014-08-29 Thread Alex De la rosa
Yeah, I know it might be hard to only use Riak, but I want to try see how
much I can do with only 1 system. If later I have to add more complexity to
the system, so be it :) but i will squeeze my brain as much as i can to
model the data in a way not much relationships may be required and probably
Riak might be enough... but we will see :)

Thanks!
Alex


On Fri, Aug 29, 2014 at 5:20 PM, Guido Medina 
wrote:

>  In a dream world my friend, we have Riak, PostgreSQL and Solr and might
> have to include a sort of query-able Big Table implementation in the future
> like Cassandra (we will try to avoid this last thing until we can't)
>
> Your Graph DB will have trade off versus KV fetch in general, I don't
> think you have the tools you need in Riak to find the relationships per
> category nor the Riak advantages to do quick KV operations (data storage
> wise) nor cluster replication.
>
> It won't be that simple without many trade off to build an homogeneous
> system.
>
> Guido.
>
>
> On 29/08/14 16:06, Alex De la rosa wrote:
>
> Hi Guido,
>
>  This could be a solution; although I would try to do it in an
> homogeneous system where only one NoSQL DB would be around if possible :)
>
>  Thanks!
> Alex
>
>
> On Fri, Aug 29, 2014 at 5:03 PM, Guido Medina 
> wrote:
>
>>  Maybe what you are looking for is a combination of both, say, your KV
>> data in Riak with a combination of background processes able to build the
>> necessary searching graphs in Neo4J, in such way your data is secure in a
>> Riak cluster and searchable on several Neo4J servers.
>>
>> That's just an idea which might be not do-able, hope it helps,
>>
>> Guido.
>>
>>
>> On 29/08/14 15:54, Alex De la rosa wrote:
>>
>>  Hi there,
>>
>>  For some time already I have in mind building a kind of social network
>> myself. Is pretty ambitious project although it doesn't have in mind to be
>> a new facebook; but still data will be quite big and complex.
>>
>>  I like Riak and I had been following since version 0.14, and new
>> additions in Riak 2.0 seem to help a lot in how to model the data; although
>> relationships will be unavoidable.
>>
>>  Some friends suggested me to use Graph Databases instead. How would
>> Riak compare to Graph Databases for this use case? Is it doable to create a
>> social network entirely from Riak? Or may not be recommended?
>>
>>  Thanks!
>> Alex
>>
>>
>>   ___
>> riak-users mailing 
>> listriak-users@lists.basho.comhttp://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: [ANN] Riak 2.0.0

2014-09-02 Thread Alex De la rosa
Awesome! Thank you very much!

Alex


On Tue, Sep 2, 2014 at 11:53 PM, Alexander Sicular 
wrote:

> Congrats to the whole Basho team. Great achievement! -Alexander
>
>
> On Tue, Sep 2, 2014 at 5:30 PM, Jared Morrow  wrote:
>
>>  Riak Users,
>>
>> We are overjoyed to announce the final release of Riak 2.0.0.
>>
>> The documentation page  has been
>> completely redone and updated for 2.0, so please see that for the most
>> complete information on 2.0. A full listing of the new features in 2.0,
>> along with links to all the relevant docs, can be found in Intro to 2.0
>> , while a guide to
>> upgrading to version 2.0 can be found in our 2.0 upgrade guide
>> .
>>
>> Downloads can also be found on the documentation page
>> , and Apt/Yum repositories
>> can be found on our packagecloud.io page
>> .
>>
>> The complete release notes for 2.0.0 can be found on GitHub
>> .
>>
>> There are roughly 700 people in our THANKS file, and about 30 tags were
>> made for 2.0 from the first “pre” to now. We appreciate both the patience
>> and the feedback of all of Riak’s users through this long release cycle.
>>
>> From the entire Basho team, thanks!
>> ​
>>
>> ___
>> 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
>
>
___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


Packagecloud.io

2014-09-02 Thread Alex De la rosa
Hi there,

The official documentation doesn't explain how to install through
packagecloud.io but instead it uses riak's own repositories:

http://docs.basho.com/riak/2.0.0/ops/building/installing/debian-ubuntu/

Also, I want to report again a problem I have with packagecloud.io; I
followed the instructions there to install my Riak 2.0 RC1 without any
issues, however, everytime I do "aptitude update" I get a hit as if a new
version of Riak is available (that is not)... so now I have no wait to do
"aptitude safe-upgrade" without having to re-install Riak to a version I
already have.

Should we avoid using packagecloud.io?

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


Re: Retrieve keys on bucket by timestamp

2014-09-04 Thread Alex De la rosa
This is really useful!

So we can use "now" as a constant to get a current timestamp?

Thanks!
Alex


On Thu, Sep 4, 2014 at 3:44 PM, Sean Cribbs  wrote:

> Hi tele,
>
> Yes, a secondary index is the most reasonable way to accomplish this.
> Here's an example using the Python client:
>
> now = time.gmtime()
> myobj.add_index('modified_int', now)
> myobj.store()
>
> bucket.get_index('modified_int', now-3600, now+3600)
>
> Hope that helps.
>
> On Wed, Sep 3, 2014 at 9:09 PM, tele  wrote:
> > Hi All,
> >
> > Is there any way i can retrieve from a bucket the keys that last
> > change N minutes ago for example.
> > If possible cis there a way to do it with riak-python-client?
> >
> > Or the only way is to add a timestamp index in the bucket and update in
> > case of changes, so that i will be able to query that index.
> >
> > Thanks
> >
> > :tele
> >
> > ___
> > riak-users mailing list
> > riak-users@lists.basho.com
> > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>
>
>
> --
> Sean Cribbs 
> Software Engineer
> Basho Technologies, Inc.
> http://basho.com/
>
> ___
> 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: Retrieve keys on bucket by timestamp

2014-09-04 Thread Alex De la rosa
damn... i got excited i missed the first line "now = time.gmtime()"...
forget my stupid question... lol

Thanks,
Alex


On Thu, Sep 4, 2014 at 4:10 PM, Alex De la rosa 
wrote:

> This is really useful!
>
> So we can use "now" as a constant to get a current timestamp?
>
> Thanks!
> Alex
>
>
> On Thu, Sep 4, 2014 at 3:44 PM, Sean Cribbs  wrote:
>
>> Hi tele,
>>
>> Yes, a secondary index is the most reasonable way to accomplish this.
>> Here's an example using the Python client:
>>
>> now = time.gmtime()
>> myobj.add_index('modified_int', now)
>> myobj.store()
>>
>> bucket.get_index('modified_int', now-3600, now+3600)
>>
>> Hope that helps.
>>
>> On Wed, Sep 3, 2014 at 9:09 PM, tele  wrote:
>> > Hi All,
>> >
>> > Is there any way i can retrieve from a bucket the keys that last
>> > change N minutes ago for example.
>> > If possible cis there a way to do it with riak-python-client?
>> >
>> > Or the only way is to add a timestamp index in the bucket and update in
>> > case of changes, so that i will be able to query that index.
>> >
>> > Thanks
>> >
>> > :tele
>> >
>> > ___
>> > riak-users mailing list
>> > riak-users@lists.basho.com
>> > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>>
>>
>>
>> --
>> Sean Cribbs 
>> Software Engineer
>> Basho Technologies, Inc.
>> http://basho.com/
>>
>> ___
>> 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: Custom data-types

2014-09-06 Thread Alex De la rosa
Hi there,

Can somebody explain the use for custom search schemas? I still don't get
why would I want to have a custom schema if the default schema seems to be
able to get me the info of all the fields i have in my object.

Thanks!
Alex


On Fri, Aug 29, 2014 at 4:48 PM, Alex De la rosa 
wrote:

> Hi Sean,
>
> Seems I was wrong, that makes total sense now that you exposed it, looked
> a "too good" feature to me, but seems is not that easy.
>
> By the way, how does "schemas" really work for Riak Search? I went back
> and read the documentation but didn't see a real difference from using the
> default schema.
>
> Thanks!
> Alex
>
>
> On Fri, Aug 29, 2014 at 3:36 PM, Sean Cribbs  wrote:
>
>> Alex,
>>
>> In short, no, you can't create custom types through schemas. Schemas
>> currently only refer to Riak Search 2.
>>
>> We would love that too, but it hasn't happened yet. The problem is not
>> conceiving of a data type but making its behavior both sensible and
>> convergent in the face of concurrent activity or network partitions.
>> For instance, say that two tweets come in around the same time. Who
>> goes first in the "stack" you described? How can multiple independent
>> copies reason about which ones to drop from the bottom of the stack to
>> keep it bounded to 100? What happens if a replica is separated from
>> the others for a while and has really stale entries, is it valid to
>> serve those to a user? What happens when one replica pushes an element
>> and another one pops it at the same time?
>>
>> These sound like they might be trivial problems, but they are
>> incredibly hard to reason about in the general case. You have to
>> reason about the ordering of events, the scope of their effects, and
>> decide on a least-surprising behavior to expose to the user. Although
>> we have given a pretty familiar/friendly interface to the data types
>> shipping in 2.0, their behavior is strictly different from the types
>> you would use in a single-threaded program in local memory.
>>
>> On Thu, Aug 28, 2014 at 4:47 PM, Alex De la rosa
>>  wrote:
>> > Hi there,
>> >
>> > Correct me if I'm wrong, but I think I read somewhere that custom
>> data-types
>> > can be created through schemas or something like that. So, apart from
>> > COUNTERS, SETS and MAPS we could have some custom defined ones.
>> >
>> > I would love to have a STACKS data-type that would work like a FIFO
>> stack,
>> > so I could save the last 100 objects for some action. Imagine we are
>> > building Twitter where millions of tweets are sent all the time, but we
>> want
>> > to quickly know the last 100 tweets for a user. Imagine something like:
>> >
>> > obj.stacks['last_tweets'].add(id_of_last_tweet)
>> >
>> > IN: last_tweet ---> STACK_OF_100_TWEETS ---> OUT: older than the 100th
>> goes
>> > out
>> >
>> > Is this possible? If so, how to do it?
>> >
>> > Thanks and Best Regards,
>> > Alex
>> >
>> > ___
>> > riak-users mailing list
>> > riak-users@lists.basho.com
>> > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>> >
>>
>>
>>
>> --
>> Sean Cribbs 
>> Software Engineer
>> Basho Technologies, Inc.
>> http://basho.com/
>>
>
>
___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


Re: Custom data-types

2014-09-06 Thread Alex De la rosa
Hi Luke,

That seems useful :) will check the Solr documentation!

Thanks!
Alex


On Sat, Sep 6, 2014 at 4:16 PM, Luke Bakken  wrote:

> Alex,
>
> Custom schemas allow you to only index a subset of your object's data
> (saving disk space). They also allow data type specification, field
> copying (to have full-text search across your object easily), and
> several other features.
>
> The Solr documentation has more information here:
>
>
> https://cwiki.apache.org/confluence/display/solr/Documents%2C+Fields%2C+and+Schema+Design
>
> --
> Luke Bakken
> Engineer / CSE
> lbak...@basho.com
>
>
> On Sat, Sep 6, 2014 at 2:20 AM, Alex De la rosa 
> wrote:
> > Hi there,
> >
> > Can somebody explain the use for custom search schemas? I still don't get
> > why would I want to have a custom schema if the default schema seems to
> be
> > able to get me the info of all the fields i have in my object.
> >
> > Thanks!
> > Alex
> >
> >
> > On Fri, Aug 29, 2014 at 4:48 PM, Alex De la rosa <
> alex.rosa@gmail.com>
> > wrote:
> >>
> >> Hi Sean,
> >>
> >> Seems I was wrong, that makes total sense now that you exposed it,
> looked
> >> a "too good" feature to me, but seems is not that easy.
> >>
> >> By the way, how does "schemas" really work for Riak Search? I went back
> >> and read the documentation but didn't see a real difference from using
> the
> >> default schema.
> >>
> >> Thanks!
> >> Alex
> >>
> >>
> >> On Fri, Aug 29, 2014 at 3:36 PM, Sean Cribbs  wrote:
> >>>
> >>> Alex,
> >>>
> >>> In short, no, you can't create custom types through schemas. Schemas
> >>> currently only refer to Riak Search 2.
> >>>
> >>> We would love that too, but it hasn't happened yet. The problem is not
> >>> conceiving of a data type but making its behavior both sensible and
> >>> convergent in the face of concurrent activity or network partitions.
> >>> For instance, say that two tweets come in around the same time. Who
> >>> goes first in the "stack" you described? How can multiple independent
> >>> copies reason about which ones to drop from the bottom of the stack to
> >>> keep it bounded to 100? What happens if a replica is separated from
> >>> the others for a while and has really stale entries, is it valid to
> >>> serve those to a user? What happens when one replica pushes an element
> >>> and another one pops it at the same time?
> >>>
> >>> These sound like they might be trivial problems, but they are
> >>> incredibly hard to reason about in the general case. You have to
> >>> reason about the ordering of events, the scope of their effects, and
> >>> decide on a least-surprising behavior to expose to the user. Although
> >>> we have given a pretty familiar/friendly interface to the data types
> >>> shipping in 2.0, their behavior is strictly different from the types
> >>> you would use in a single-threaded program in local memory.
> >>>
> >>> On Thu, Aug 28, 2014 at 4:47 PM, Alex De la rosa
> >>>  wrote:
> >>> > Hi there,
> >>> >
> >>> > Correct me if I'm wrong, but I think I read somewhere that custom
> >>> > data-types
> >>> > can be created through schemas or something like that. So, apart from
> >>> > COUNTERS, SETS and MAPS we could have some custom defined ones.
> >>> >
> >>> > I would love to have a STACKS data-type that would work like a FIFO
> >>> > stack,
> >>> > so I could save the last 100 objects for some action. Imagine we are
> >>> > building Twitter where millions of tweets are sent all the time, but
> we
> >>> > want
> >>> > to quickly know the last 100 tweets for a user. Imagine something
> like:
> >>> >
> >>> > obj.stacks['last_tweets'].add(id_of_last_tweet)
> >>> >
> >>> > IN: last_tweet ---> STACK_OF_100_TWEETS ---> OUT: older than the
> 100th
> >>> > goes
> >>> > out
> >>> >
> >>> > Is this possible? If so, how to do it?
> >>> >
> >>> > Thanks and Best Regards,
> >>> > Alex
> >>> >
> >>> > ___
> >>> > riak-users mailing list
> >>> > riak-users@lists.basho.com
> >>> > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
> >>> >
> >>>
> >>>
> >>>
> >>> --
> >>> Sean Cribbs 
> >>> Software Engineer
> >>> Basho Technologies, Inc.
> >>> http://basho.com/
> >>
> >>
> >
> >
> > ___
> > 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


Can't delete objects being on an indexed bucket_type

2014-11-15 Thread Alex De la rosa
Hi there,

I created an index and a MAP bucket-type in the following way:

curl -XPUT "http://x.x.x.x:8098/search/index/ix_users";
riak-admin bucket-type create tp_users '{"props":
{"allow_mult":true,"search_index":"ix_users","datatype":"map"}}'
riak-admin bucket-type activate tp_users

Then I saved some data and is working fine; but when I try to delete a key,
I get a nasty error; what am I doing wrong?:

import riak

client = riak.RiakClient(protocol = 'pbc', nodes = [{'host': 'x.x.x.x',
'http_port': 8098, 'pb_port': 8087}])
bucket = client.bucket_type('tp_users').bucket('users')
bucket.delete('testkey')

Output of the script:

Traceback (most recent call last):
  File "x.py", line 6, in 
bucket.delete('testkey')
  File "/usr/local/lib/python2.7/dist-packages/riak/bucket.py", line 539,
in delete
return self.new(key).delete(**kwargs)
AttributeError: 'Map' object has no attribute 'delete'

This are my riak and python client versions:

~ # pip show riak
---
Name: riak
Version: 2.1.0
Location: /usr/local/lib/python2.7/dist-packages
Requires: riak-pb, pyOpenSSL

~ # riak version
2.0.2

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


Re: Can't delete objects being on an indexed bucket_type

2014-11-16 Thread Alex De la rosa
Hi Sean,

Seams that the workaround suggested hits the same error:

Traceback (most recent call last):
  File "x.py", line 9, in 
RiakObject(bucket, 'testkey').delete()
  File "/usr/local/lib/python2.7/dist-packages/riak/riak_object.py", line
335, in delete
timeout=timeout)
  File "/usr/local/lib/python2.7/dist-packages/riak/bucket.py", line 539,
in delete
return self.new(key).delete(**kwargs)
AttributeError: 'Map' object has no attribute 'delete'

Thanks,
Alex

On Sun, Nov 16, 2014 at 8:02 PM, Sean Cribbs  wrote:

> Hi Alex,
>
> That's a bug in the Python client. There's an existing issue on the repo
> for it: https://github.com/basho/riak-python-client/issues/365
>
> In the meantime, here's a workaround:
>
> from riak.riak_object import RiakObject
>
> RiakObject(bucket, 'testkey').delete()
>
> Sorry for the inconvenience.
>
> On Sat, Nov 15, 2014 at 5:54 PM, Alex De la rosa 
> wrote:
>
>> Hi there,
>>
>> I created an index and a MAP bucket-type in the following way:
>>
>> curl -XPUT "http://x.x.x.x:8098/search/index/ix_users";
>> riak-admin bucket-type create tp_users '{"props":
>> {"allow_mult":true,"search_index":"ix_users","datatype":"map"}}'
>> riak-admin bucket-type activate tp_users
>>
>> Then I saved some data and is working fine; but when I try to delete a
>> key, I get a nasty error; what am I doing wrong?:
>>
>> import riak
>>
>> client = riak.RiakClient(protocol = 'pbc', nodes = [{'host': 'x.x.x.x',
>> 'http_port': 8098, 'pb_port': 8087}])
>> bucket = client.bucket_type('tp_users').bucket('users')
>> bucket.delete('testkey')
>>
>> Output of the script:
>>
>> Traceback (most recent call last):
>>   File "x.py", line 6, in 
>> bucket.delete('testkey')
>>   File "/usr/local/lib/python2.7/dist-packages/riak/bucket.py", line 539,
>> in delete
>> return self.new(key).delete(**kwargs)
>> AttributeError: 'Map' object has no attribute 'delete'
>>
>> This are my riak and python client versions:
>>
>> ~ # pip show riak
>> ---
>> Name: riak
>> Version: 2.1.0
>> Location: /usr/local/lib/python2.7/dist-packages
>> Requires: riak-pb, pyOpenSSL
>>
>> ~ # riak version
>> 2.0.2
>>
>> Thanks,
>> Alex
>>
>> ___
>> riak-users mailing list
>> riak-users@lists.basho.com
>> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>>
>>
>
>
> --
> Sean Cribbs 
> Sr. Software Engineer
> Basho Technologies, Inc.
> http://basho.com/
>
___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


Re: Can't delete objects being on an indexed bucket_type

2014-11-16 Thread Alex De la rosa
Yeah! this time worked :) thanks! Any ideas when a new release for the
Python client coming with that bug fixed?

Thanks,
Alex

On Mon, Nov 17, 2014 at 2:02 AM, Sean Cribbs  wrote:

> Sorry, I made a mistake in the example. Try this:
>
> RiakObject(bucket._client, bucket, 'testkey').delete()
>
> On Sun, Nov 16, 2014 at 3:15 PM, Alex De la rosa 
> wrote:
>
>> Hi Sean,
>>
>> Seams that the workaround suggested hits the same error:
>>
>> Traceback (most recent call last):
>>   File "x.py", line 9, in 
>> RiakObject(bucket, 'testkey').delete()
>>   File "/usr/local/lib/python2.7/dist-packages/riak/riak_object.py", line
>> 335, in delete
>> timeout=timeout)
>>   File "/usr/local/lib/python2.7/dist-packages/riak/bucket.py", line 539,
>> in delete
>> return self.new(key).delete(**kwargs)
>> AttributeError: 'Map' object has no attribute 'delete'
>>
>> Thanks,
>> Alex
>>
>> On Sun, Nov 16, 2014 at 8:02 PM, Sean Cribbs  wrote:
>>
>>> Hi Alex,
>>>
>>> That's a bug in the Python client. There's an existing issue on the repo
>>> for it: https://github.com/basho/riak-python-client/issues/365
>>>
>>> In the meantime, here's a workaround:
>>>
>>> from riak.riak_object import RiakObject
>>>
>>> RiakObject(bucket, 'testkey').delete()
>>>
>>> Sorry for the inconvenience.
>>>
>>> On Sat, Nov 15, 2014 at 5:54 PM, Alex De la rosa <
>>> alex.rosa@gmail.com> wrote:
>>>
>>>> Hi there,
>>>>
>>>> I created an index and a MAP bucket-type in the following way:
>>>>
>>>> curl -XPUT "http://x.x.x.x:8098/search/index/ix_users";
>>>> riak-admin bucket-type create tp_users '{"props":
>>>> {"allow_mult":true,"search_index":"ix_users","datatype":"map"}}'
>>>> riak-admin bucket-type activate tp_users
>>>>
>>>> Then I saved some data and is working fine; but when I try to delete a
>>>> key, I get a nasty error; what am I doing wrong?:
>>>>
>>>> import riak
>>>>
>>>> client = riak.RiakClient(protocol = 'pbc', nodes = [{'host': 'x.x.x.x',
>>>> 'http_port': 8098, 'pb_port': 8087}])
>>>> bucket = client.bucket_type('tp_users').bucket('users')
>>>> bucket.delete('testkey')
>>>>
>>>> Output of the script:
>>>>
>>>> Traceback (most recent call last):
>>>>   File "x.py", line 6, in 
>>>> bucket.delete('testkey')
>>>>   File "/usr/local/lib/python2.7/dist-packages/riak/bucket.py", line
>>>> 539, in delete
>>>> return self.new(key).delete(**kwargs)
>>>> AttributeError: 'Map' object has no attribute 'delete'
>>>>
>>>> This are my riak and python client versions:
>>>>
>>>> ~ # pip show riak
>>>> ---
>>>> Name: riak
>>>> Version: 2.1.0
>>>> Location: /usr/local/lib/python2.7/dist-packages
>>>> Requires: riak-pb, pyOpenSSL
>>>>
>>>> ~ # riak version
>>>> 2.0.2
>>>>
>>>> Thanks,
>>>> Alex
>>>>
>>>> ___
>>>> riak-users mailing list
>>>> riak-users@lists.basho.com
>>>> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>>>>
>>>>
>>>
>>>
>>> --
>>> Sean Cribbs 
>>> Sr. Software Engineer
>>> Basho Technologies, Inc.
>>> http://basho.com/
>>>
>>
>>
>
>
> --
> Sean Cribbs 
> Sr. Software Engineer
> Basho Technologies, Inc.
> http://basho.com/
>
___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


Re: Can't delete objects being on an indexed bucket_type

2014-11-17 Thread Alex De la rosa
Awesome, thanks :)

On Mon, Nov 17, 2014 at 4:52 PM, Sean Cribbs  wrote:

> I'll confer with Brett, who is wrapping up some Python 3 compatibility,
> another release is needed soon.
>
> On Mon, Nov 17, 2014 at 1:12 AM, Alex De la rosa 
> wrote:
>
>> Yeah! this time worked :) thanks! Any ideas when a new release for the
>> Python client coming with that bug fixed?
>>
>> Thanks,
>> Alex
>>
>> On Mon, Nov 17, 2014 at 2:02 AM, Sean Cribbs  wrote:
>>
>>> Sorry, I made a mistake in the example. Try this:
>>>
>>> RiakObject(bucket._client, bucket, 'testkey').delete()
>>>
>>> On Sun, Nov 16, 2014 at 3:15 PM, Alex De la rosa <
>>> alex.rosa@gmail.com> wrote:
>>>
>>>> Hi Sean,
>>>>
>>>> Seams that the workaround suggested hits the same error:
>>>>
>>>> Traceback (most recent call last):
>>>>   File "x.py", line 9, in 
>>>> RiakObject(bucket, 'testkey').delete()
>>>>   File "/usr/local/lib/python2.7/dist-packages/riak/riak_object.py",
>>>> line 335, in delete
>>>> timeout=timeout)
>>>>   File "/usr/local/lib/python2.7/dist-packages/riak/bucket.py", line
>>>> 539, in delete
>>>> return self.new(key).delete(**kwargs)
>>>> AttributeError: 'Map' object has no attribute 'delete'
>>>>
>>>> Thanks,
>>>> Alex
>>>>
>>>> On Sun, Nov 16, 2014 at 8:02 PM, Sean Cribbs  wrote:
>>>>
>>>>> Hi Alex,
>>>>>
>>>>> That's a bug in the Python client. There's an existing issue on the
>>>>> repo for it: https://github.com/basho/riak-python-client/issues/365
>>>>>
>>>>> In the meantime, here's a workaround:
>>>>>
>>>>> from riak.riak_object import RiakObject
>>>>>
>>>>> RiakObject(bucket, 'testkey').delete()
>>>>>
>>>>> Sorry for the inconvenience.
>>>>>
>>>>> On Sat, Nov 15, 2014 at 5:54 PM, Alex De la rosa <
>>>>> alex.rosa@gmail.com> wrote:
>>>>>
>>>>>> Hi there,
>>>>>>
>>>>>> I created an index and a MAP bucket-type in the following way:
>>>>>>
>>>>>> curl -XPUT "http://x.x.x.x:8098/search/index/ix_users";
>>>>>> riak-admin bucket-type create tp_users '{"props":
>>>>>> {"allow_mult":true,"search_index":"ix_users","datatype":"map"}}'
>>>>>> riak-admin bucket-type activate tp_users
>>>>>>
>>>>>> Then I saved some data and is working fine; but when I try to delete
>>>>>> a key, I get a nasty error; what am I doing wrong?:
>>>>>>
>>>>>> import riak
>>>>>>
>>>>>> client = riak.RiakClient(protocol = 'pbc', nodes = [{'host':
>>>>>> 'x.x.x.x', 'http_port': 8098, 'pb_port': 8087}])
>>>>>> bucket = client.bucket_type('tp_users').bucket('users')
>>>>>> bucket.delete('testkey')
>>>>>>
>>>>>> Output of the script:
>>>>>>
>>>>>> Traceback (most recent call last):
>>>>>>   File "x.py", line 6, in 
>>>>>> bucket.delete('testkey')
>>>>>>   File "/usr/local/lib/python2.7/dist-packages/riak/bucket.py", line
>>>>>> 539, in delete
>>>>>> return self.new(key).delete(**kwargs)
>>>>>> AttributeError: 'Map' object has no attribute 'delete'
>>>>>>
>>>>>> This are my riak and python client versions:
>>>>>>
>>>>>> ~ # pip show riak
>>>>>> ---
>>>>>> Name: riak
>>>>>> Version: 2.1.0
>>>>>> Location: /usr/local/lib/python2.7/dist-packages
>>>>>> Requires: riak-pb, pyOpenSSL
>>>>>>
>>>>>> ~ # riak version
>>>>>> 2.0.2
>>>>>>
>>>>>> Thanks,
>>>>>> Alex
>>>>>>
>>>>>> ___
>>>>>> riak-users mailing list
>>>>>> riak-users@lists.basho.com
>>>>>> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Sean Cribbs 
>>>>> Sr. Software Engineer
>>>>> Basho Technologies, Inc.
>>>>> http://basho.com/
>>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Sean Cribbs 
>>> Sr. Software Engineer
>>> Basho Technologies, Inc.
>>> http://basho.com/
>>>
>>
>>
>
>
> --
> Sean Cribbs 
> Sr. Software Engineer
> Basho Technologies, Inc.
> http://basho.com/
>
___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


Re: Can't delete objects being on an indexed bucket_type

2014-12-18 Thread Alex De la rosa
Hi Sean,

I wonder how the Python client progress goes? I didn't see any news about
it and PIP seems to not have a new version... when will the delete bug
fixed?

Thanks,
Alex

On Mon, Nov 17, 2014 at 4:53 PM, Alex De la rosa 
wrote:
>
> Awesome, thanks :)
>
> On Mon, Nov 17, 2014 at 4:52 PM, Sean Cribbs  wrote:
>
>> I'll confer with Brett, who is wrapping up some Python 3 compatibility,
>> another release is needed soon.
>>
>> On Mon, Nov 17, 2014 at 1:12 AM, Alex De la rosa > > wrote:
>>
>>> Yeah! this time worked :) thanks! Any ideas when a new release for the
>>> Python client coming with that bug fixed?
>>>
>>> Thanks,
>>> Alex
>>>
>>> On Mon, Nov 17, 2014 at 2:02 AM, Sean Cribbs  wrote:
>>>
>>>> Sorry, I made a mistake in the example. Try this:
>>>>
>>>> RiakObject(bucket._client, bucket, 'testkey').delete()
>>>>
>>>> On Sun, Nov 16, 2014 at 3:15 PM, Alex De la rosa <
>>>> alex.rosa@gmail.com> wrote:
>>>>
>>>>> Hi Sean,
>>>>>
>>>>> Seams that the workaround suggested hits the same error:
>>>>>
>>>>> Traceback (most recent call last):
>>>>>   File "x.py", line 9, in 
>>>>> RiakObject(bucket, 'testkey').delete()
>>>>>   File "/usr/local/lib/python2.7/dist-packages/riak/riak_object.py",
>>>>> line 335, in delete
>>>>> timeout=timeout)
>>>>>   File "/usr/local/lib/python2.7/dist-packages/riak/bucket.py", line
>>>>> 539, in delete
>>>>> return self.new(key).delete(**kwargs)
>>>>> AttributeError: 'Map' object has no attribute 'delete'
>>>>>
>>>>> Thanks,
>>>>> Alex
>>>>>
>>>>> On Sun, Nov 16, 2014 at 8:02 PM, Sean Cribbs  wrote:
>>>>>
>>>>>> Hi Alex,
>>>>>>
>>>>>> That's a bug in the Python client. There's an existing issue on the
>>>>>> repo for it: https://github.com/basho/riak-python-client/issues/365
>>>>>>
>>>>>> In the meantime, here's a workaround:
>>>>>>
>>>>>> from riak.riak_object import RiakObject
>>>>>>
>>>>>> RiakObject(bucket, 'testkey').delete()
>>>>>>
>>>>>> Sorry for the inconvenience.
>>>>>>
>>>>>> On Sat, Nov 15, 2014 at 5:54 PM, Alex De la rosa <
>>>>>> alex.rosa@gmail.com> wrote:
>>>>>>
>>>>>>> Hi there,
>>>>>>>
>>>>>>> I created an index and a MAP bucket-type in the following way:
>>>>>>>
>>>>>>> curl -XPUT "http://x.x.x.x:8098/search/index/ix_users";
>>>>>>> riak-admin bucket-type create tp_users '{"props":
>>>>>>> {"allow_mult":true,"search_index":"ix_users","datatype":"map"}}'
>>>>>>> riak-admin bucket-type activate tp_users
>>>>>>>
>>>>>>> Then I saved some data and is working fine; but when I try to delete
>>>>>>> a key, I get a nasty error; what am I doing wrong?:
>>>>>>>
>>>>>>> import riak
>>>>>>>
>>>>>>> client = riak.RiakClient(protocol = 'pbc', nodes = [{'host':
>>>>>>> 'x.x.x.x', 'http_port': 8098, 'pb_port': 8087}])
>>>>>>> bucket = client.bucket_type('tp_users').bucket('users')
>>>>>>> bucket.delete('testkey')
>>>>>>>
>>>>>>> Output of the script:
>>>>>>>
>>>>>>> Traceback (most recent call last):
>>>>>>>   File "x.py", line 6, in 
>>>>>>> bucket.delete('testkey')
>>>>>>>   File "/usr/local/lib/python2.7/dist-packages/riak/bucket.py", line
>>>>>>> 539, in delete
>>>>>>> return self.new(key).delete(**kwargs)
>>>>>>> AttributeError: 'Map' object has no attribute 'delete'
>>>>>>>
>>>>>>> This are my riak and python client versions:
>>>>>>>
>>>>>>> ~ # pip show riak
>>>>>>> ---
>>>>>>> Name: riak
>>>>>>> Version: 2.1.0
>>>>>>> Location: /usr/local/lib/python2.7/dist-packages
>>>>>>> Requires: riak-pb, pyOpenSSL
>>>>>>>
>>>>>>> ~ # riak version
>>>>>>> 2.0.2
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Alex
>>>>>>>
>>>>>>> ___
>>>>>>> riak-users mailing list
>>>>>>> riak-users@lists.basho.com
>>>>>>> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Sean Cribbs 
>>>>>> Sr. Software Engineer
>>>>>> Basho Technologies, Inc.
>>>>>> http://basho.com/
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Sean Cribbs 
>>>> Sr. Software Engineer
>>>> Basho Technologies, Inc.
>>>> http://basho.com/
>>>>
>>>
>>>
>>
>>
>> --
>> Sean Cribbs 
>> Sr. Software Engineer
>> Basho Technologies, Inc.
>> http://basho.com/
>>
>
>
___
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


Re: Can't delete objects being on an indexed bucket_type

2014-12-18 Thread Alex De la rosa
Awesome! Thank you so much :)

Alex

On Friday, December 19, 2014, Brett Hazen  wrote:

> Alex —
>
> The new version was released today, including this feature.  Announcement
> to follow.
>
> Brett
>
> On December 18, 2014 at 4:43:10 AM, Alex De la rosa (
> alex.rosa@gmail.com
> ) wrote:
>
> Hi Sean,
>
> I wonder how the Python client progress goes? I didn't see any news about
> it and PIP seems to not have a new version... when will the delete bug
> fixed?
>
> Thanks,
> Alex
>
> On Mon, Nov 17, 2014 at 4:53 PM, Alex De la rosa  > wrote:
>>
>> Awesome, thanks :)
>>
>> On Mon, Nov 17, 2014 at 4:52 PM, Sean Cribbs > > wrote:
>>
>>> I'll confer with Brett, who is wrapping up some Python 3 compatibility,
>>> another release is needed soon.
>>>
>>> On Mon, Nov 17, 2014 at 1:12 AM, Alex De la rosa <
>>> alex.rosa@gmail.com
>>> > wrote:
>>>
>>>> Yeah! this time worked :) thanks! Any ideas when a new release for the
>>>> Python client coming with that bug fixed?
>>>>
>>>> Thanks,
>>>> Alex
>>>>
>>>> On Mon, Nov 17, 2014 at 2:02 AM, Sean Cribbs >>> > wrote:
>>>>
>>>>> Sorry, I made a mistake in the example. Try this:
>>>>>
>>>>> RiakObject(bucket._client, bucket, 'testkey').delete()
>>>>>
>>>>> On Sun, Nov 16, 2014 at 3:15 PM, Alex De la rosa <
>>>>> alex.rosa@gmail.com
>>>>> > wrote:
>>>>>
>>>>>> Hi Sean,
>>>>>>
>>>>>> Seams that the workaround suggested hits the same error:
>>>>>>
>>>>>> Traceback (most recent call last):
>>>>>>   File "x.py", line 9, in 
>>>>>> RiakObject(bucket, 'testkey').delete()
>>>>>>   File "/usr/local/lib/python2.7/dist-packages/riak/riak_object.py",
>>>>>> line 335, in delete
>>>>>> timeout=timeout)
>>>>>>   File "/usr/local/lib/python2.7/dist-packages/riak/bucket.py", line
>>>>>> 539, in delete
>>>>>> return self.new(key).delete(**kwargs)
>>>>>> AttributeError: 'Map' object has no attribute 'delete'
>>>>>>
>>>>>> Thanks,
>>>>>> Alex
>>>>>>
>>>>>> On Sun, Nov 16, 2014 at 8:02 PM, Sean Cribbs >>>>> > wrote:
>>>>>>
>>>>>>> Hi Alex,
>>>>>>>
>>>>>>> That's a bug in the Python client. There's an existing issue on the
>>>>>>> repo for it: https://github.com/basho/riak-python-client/issues/365
>>>>>>>
>>>>>>> In the meantime, here's a workaround:
>>>>>>>
>>>>>>> from riak.riak_object import RiakObject
>>>>>>>
>>>>>>> RiakObject(bucket, 'testkey').delete()
>>>>>>>
>>>>>>> Sorry for the inconvenience.
>>>>>>>
>>>>>>>  On Sat, Nov 15, 2014 at 5:54 PM, Alex De la rosa <
>>>>>>> alex.rosa@gmail.com
>>>>>>> > wrote:
>>>>>>>
>>>>>>>>   Hi there,
>>>>>>>>
>>>>>>>> I created an index and a MAP bucket-type in the following way:
>>>>>>>>
>>>>>>>> curl -XPUT "http://x.x.x.x:8098/search/index/ix_users";
>>>>>>>> riak-admin bucket-type create tp_users '{"props":
>>>>>>>> {"allow_mult":true,"search_index":"ix_users","datatype":"map"}}'
>>>>>>>> riak-admin bucket-type activate tp_users
>>>>>>>>
>>>>>>>> Then I saved some data and is working fine; but when I try to
>>>>>>>> delete a key, I get a nasty error; what am I doing wrong?:
>>>>>>>>
>>>>>>>> import riak
>>>>>>>>
>>>>>>>> client = riak.RiakClient(protocol = 'pbc', nodes = [{'host':
>>>>>>>> 'x.x.x.x', 'http_port': 8098, 'pb_port': 8087}])
>>>>>>>> bucket = client.bucket

deleting a register (Python client)

2014-12-19 Thread Alex De la rosa
Hi there,

This is a pretty dumb question but I think I have never recalled doing it
before. Imagine that I have a register called "something" with a value:

obj.registers['something'].assign('blah')

If later on I want to remove this "something" register from the riak map
object, how to do it? I don't seem to find anywhere in the documentation
how to remove a register.

I could set up an empty string: obj.registers['something'].assign(''), as I
see that when you fetch a register that doesn't exist it returns an empty
string instead of a None. Is this the only way? Or can we remove it in some
other way?

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


  1   2   >