That cleared it up, thanks! Indeed, I was trying to add the index k/v as regular meta in the headers.
On Mon, Jan 9, 2012 at 12:37 AM, Russell Brown <[email protected]> wrote: > Hi Daniel, > > On 9 Jan 2012, at 08:22, Daniel Rathbone wrote: > > I'm trying out 2i, and I'm having a little trouble similar to this old > thread. I don't see any keys returned when I try and query a secondary > index. > > My storage_backend is set to riak_kv_eleveldb_backend. I seem to have > added values to the secondary index well enough - I can see a header > "X-Riak-Meta-All: 2" returned when I request the object by it's regular > key. > > > How did you add an index to the object? A header of 'X-Riak-Meta-All' > suggests that you added some user meta, I would hope to see a header like > 'x-riak-index-all_int' in the response. You can add a secondary index like > this > > curl -X POST -H 'x-riak-index-all_int: 2' -d 'YOUR DATA' > http://localhost:8071/buckets/YOUR_BUCKET/keys/YOUR_KEY > > When I try and query the 2i, > > curl -v "127.0.0.1:8071/buckets/cpg_mb/index/all_int/0/5" > > > Your query looks right. You can read more on the Basho wiki here[1] and > here[2] > > Cheers > > Russell > > [1] http://wiki.basho.com/HTTP-Store-Object.html > [2] http://wiki.basho.com/HTTP-Secondary-Indexes.html > > > I simply get > > {"keys":[]} > > Is there any other configuration I need to set? I simply changed my > backend to ELevelDB and restarted my (single) node. Any other ideas? > > Thanks, > Daniel > > On Thu, Aug 4, 2011 at 10:35 AM, Craig Muth <[email protected]> wrote: > >> > you'll need to look in etc/app.config in the release directory and >> change the value for the storage_backend setting to riak_kv_index_backend >> >> Thanks. >> >> How stable is the riak_kv_index_backend? If we're aiming to go to prod >> in a couple months would we be better advised to use riak search? It seems >> as though it's functionality is a superset of secondary indexing, though >> more painful to implement. >> >> --Craig >> >> >> >> On Wed, Aug 3, 2011 at 9:48 PM, Jeremiah Peschka < >> [email protected]> wrote: >> >>> I believe 1.0 is scheduled for November. >>> >>> --- >>> Jeremiah Peschka >>> Founder, Brent Ozar PLF, LLC >>> >>> On Aug 3, 2011, at 9:47 PM, Antonio Rohman Fernandez wrote: >>> >>> > Another question... the old problem of querying smaller buckets with >>> MapReduce is resolved with secondary indexes? >>> > following this pattern => curl >>> http://127.0.0.1:8098/buckets/loot/index/category_bin/eq/armor i think >>> Riak doesn't have to check all the buckets/keys in memory to match the one >>> you look for as it happened on a MapReduce, right? so >>> http://127.0.0.1:8098/buckets/rohman_messages/index/date_int/eq/20110801would >>> give me all messages from Rohman ( in a personalized bucket ) for the >>> day 1st of August of 2011 in a much faster way, right? >>> > thanks >>> > >>> > Rohman >>> > >>> > On Thu, 04 Aug 2011 12:38:17 +0800, Antonio Rohman Fernandez wrote: >>> > >>> >> seeing OSCON's PDF... when will we be able to have Riak 1.0 with >>> secondary indexes out? This is an improvement that can help me pretty well >>> out on my project. Any ETA? >>> >> thanks >>> >> >>> >> Rohman >>> >> >>> >> On Wed, 3 Aug 2011 22:02:53 -0600, Kelly McLaughlin wrote: >>> >> >>> >> Craig, >>> >> The default backend is bit cask and if you want to use the indexes >>> you'll need to look in etc/app.config in the release directory and change >>> the value for the storage_backend setting to riak_kv_index_backend instead >>> of riak_kv_bitcask_backend. I suspect that's the problem. Cheers. >>> >> Kelly >>> >> >>> >> On Aug 3, 2011, at 9:42 PM, Craig Muth wrote: >>> >> >>> >> I'm running the code example from >>> http://rusty.basho.com.s3.amazonaws.com/Presentations/2011-OSCONData-Portland.pdf >>> >> This succeeds: >>> >> curl \ >>> >> -X PUT \ >>> >> -d "OPAQUE_VALUE" \ >>> >> -H "x-riak-index-category_bin: armor" \ >>> >> -H "x-riak-index-price_int: 400" \ >>> >> http://127.0.0.1:8098/buckets/loot/keys/gauntlet24 >>> >> This verifies it's getting there: >>> >> curl http://127.0.0.1:8098/riak/loot/gauntlet24 >>> >> => OPAQUE_VALUE >>> >> However, this finds nothing: >>> >> curl http://127.0.0.1:8098/buckets/loot/index/category_bin/eq/armor >>> >> => {"keys":[]} >>> >> Whereas in the presentation it says it should return >>> {"keys":["gauntlet24"]} >>> >> Any ideas? Just grabbed the latest from github master. >>> >> --Craig >>> >> _______________________________________________ >>> >> riak-users mailing list >>> >> [email protected] >>> >> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com >>> >> -- >>> >> <blocked.gif> >>> >> <blocked.gif> Antonio Rohman Fernandez >>> >> CEO, Founder & Lead Engineer >>> >> [email protected] Projects >>> >> MaruBatsu.es >>> >> PupCloud.com >>> >> Wedding Album<blocked.gif> >>> > -- >>> > >>> > Antonio Rohman Fernandez >>> > CEO, Founder & Lead Engineer >>> > [email protected] Projects >>> > MaruBatsu.es >>> > PupCloud.com >>> > Wedding Album >>> > _______________________________________________ >>> > riak-users mailing list >>> > [email protected] >>> > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com >>> >>> >>> _______________________________________________ >>> riak-users mailing list >>> [email protected] >>> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com >>> >> >> >> _______________________________________________ >> riak-users mailing list >> [email protected] >> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com >> >> > > > -- > sent from Dan Rathbone's personal email account > http://danrathbone.com -- personal site > http://eastlakeblog.org -- neighborhood blog > > _______________________________________________ > riak-users mailing list > [email protected] > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com > > > -- sent from Dan Rathbone's personal email account http://danrathbone.com -- personal site http://eastlakeblog.org -- neighborhood blog
_______________________________________________ riak-users mailing list [email protected] http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
