solrriakriak-search

Multiple queries in Riak


I am querying my Riak database through the HTTP API like so:

/select?q=+build:2702168+hypervisors:500&q.op=and&wt=json&sort=tstart_int%20desc"

but all other query parameters than the first one gets ignored. So in this case, it returns all entries that fulfill build:2702168, but ignores hypervisors:500.

This piece of documentation, although old, shows that you can do regular solr multi-queries:

The following example return documents containing the words “red” and “blue” but not “yellow”.

red AND blue AND NOT yellow 

The required ( + ) operator can be used in place of “AND”, and the prohibited ( - ) operator can be used in place of “AND NOT”. For example, the query above can be rewritten as:

+red +blue -yellow

However, I can't find the same information in the latest Riak docs. Is there another way of doing it?


Solution

  • This seems to a pretty old bug. According to Basho's Ryan Zezeski:

    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

    And as he says, doing this instead:

    /select?q=build:2702168%20AND%20hypervisors:500&wt=json&sort=tstart_int%20desc
    

    fixed the problem.