Riak Search "And" Queries inconsistency with Lucene

Dan Reverri dan at basho.com
Sat May 14 14:40:32 EDT 2011


Hi Tejus,

The boolean operators must be capitalized (AND, OR, NOT). If you retry your
searches with "AND" they will return the expected results.

Also, thank you for the very well put together examples.

Thanks,
Dan

Daniel Reverri
Developer Advocate
Basho Technologies, Inc.
dan at basho.com


On Sat, May 14, 2011 at 9:28 AM, Tejus Parikh <tejus at vijedi.net> wrote:

> I am considering using Riaksearch to replace a project that currently makes
> use of lucene. This project extensively uses 'AND' queries to return a very
> small subset of the total document store. Given that riaksearch provides a
> "solr" endpoint, I would have expected the queries to return the same
> results, but that does not appear to be the case.
>
> I created a simple test containing three documents (described here as xml):
>     <doc>
>         <field name="id">1</field>
>         <field name="topping_text">strawberry</field>
>         <field name="base_text">pastry</field>
>     </doc>
>     <doc>
>         <field name="id">2</field>
>         <field name="topping_text">blueberry</field>
>         <field name="base_text">waffle</field>
>     </doc>
>     <doc>
>         <field name="id">3</field>
>         <field name="topping_text">strawberry</field>
>         <field name="base_text">pancake</field>
>     </doc>
>
> I ran a few queries against this set of docs:
> search-cmd search menu_index "topping_text:\"strawberry\""
> ** This returns 2 documents
>
> search-cmd search menu_index "topping_text:\"strawberry\" and
> base_text:\"pastry\""
> ** This returns 2 documents, I think it should only return menu_index/1
>
> search-cmd search menu_index "topping_text:\"strawberry\" and
> base_text:\"waffles\""
> ** This returns 3 documents, it shouldn't return any
>
> For comparions sake, I ran the same queries against lucene and retrieved
> the results I expected.
>
> I've uploaded my documents, the commands I used to create an index, and the
> sample lucene java code to:
> https://github.com/vijedi/Riak-Search--And--Query-Test
>
> Have I misinterpreted what is happening or is there a real difference here?
>
> Thanks!
>
> Tejus Parikh
> tejusparikh.com | @vi_jedi
>
>
> _______________________________________________
> riak-users mailing list
> riak-users at lists.basho.com
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20110514/6d4b44e6/attachment.html>


More information about the riak-users mailing list