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

Reply via email to