Mick, This is a bug. At one time I fixed it but it had to be reverted because it broke rolling upgrade [1]. It has languished ever since. To work around explicitly put AND in the query. E.g. q=nickname:Ring%20AND%20breed:Shepherd
-Z [1]: https://github.com/basho/riak_search/commit/67ca6efca7cd0a92c4d7e323aa3fd7a37df27315 On Sat, Jul 21, 2012 at 9:13 AM, Mick Brooks <mick.bro...@sinking.in> wrote: > Hi, > > I'm playing with Riak thanks to working through the Seven DBs in Seven > Weeks book: < > http://pragprog.com/book/rwdata/seven-databases-in-seven-weeks>. > One of the examples has left me confused, and I wondered if anyone could > spot where I'm going wrong. > > I've got a dev cluster running Riak 1.1.4, and have turned on Riak search. > I've > created a bucket named new_animals and added the following 3 objects: > > $ curl -X PUT http://localhost:8091/riak/new_animals/dragon \ > -H "Content-Type: application/json" \ > -d '{"nickname" : "Dragon", "breed" : "Briard", "score" : 1 }' > $ curl -X PUT http://localhost:8091/riak/new_animals/ace \ > -H "Content-Type: application/json" \ > -d '{"nickname" : "The Wonder Dog", "breed" : "German Shepherd", > "score" : 3 }' > $ curl -X PUT http://localhost:8091/riak/new_animals/rtt \ > -H "Content-Type: application/json" \ > -d '{"nickname" : "Rin Tin Tin", "breed" : "German Shepherd", "score" : > 4 }' > > Now I try to search using the and operator: > > $ curl ' > http://localhost:8091/solr/new_animals/select?q=nickname:Rin%20breed:Shepherd&q.op=and > ' > <?xml version="1.0" encoding="UTF-8"?> > <response> > <lst name="responseHeader"> > <int name="status">0</int> > <int name="QTime">4</int> > <lst name="params"> > <str name="indent">on</str> > <str name="start">0</str> > <str name="q">nickname:Rin breed:Shepherd</str> > <str name="q.op">and</str> > <str name="filter"></str> > <str name="df">value</str> > <str name="wt">standard</str> > <str name="version">1.1</str> > <str name="rows">2</str> > </lst> > </lst> > <result name="response" numFound="2" start="0" maxScore="1.28338"> > <doc> > <str name="id">rtt > </str> > <str name="breed">German Shepherd > </str> > <str name="nickname">Rin Tin Tin > </str> > <str name="score">4 > </str> > </doc> > <doc> > <str name="id">ace > </str> > <str name="breed">German Shepherd > </str> > <str name="nickname">The Wonder Dog > </str> > <str name="score">3 > </str> > </doc> > </result> > </response> > > I expected only one result to match, but have two. 'ace' should fail > to match the nickname:Rin term, so does it make sense that it's returned > for this query? > > Cheers, > > Mick > > -- > Mick Brooks > ACCU Membership Secretary - accumembers...@accu.org > http://www.accu.org/ - Professionalism in Programming > > _______________________________________________ > 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