couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nils Breunese <>
Subject Re: request with OR conditions
Date Tue, 11 Dec 2012 09:31:56 GMT
svilen <> wrote:

> {keys: list-of-keys} is an OR, not AND - {keys : [1,2]} means give 
> items with key=1 OR key=2 
> (human language is not math - "give me the apple and the orange" is not
> same as "give me the thing that is apple and is orange".
> so if u normalize your query into OR ( ANDs ), and build n-dimensional
> array-key [tag1,tag2,tag3,tag4,...tagn], u could do it - in
> theory...  it's not dynamic - so n is constant. and u cant filter on
> tag2 without tag1.. sub-keys can only be like key1..keym where m<=n
> the only other/real way is do n queries for your current OR parts,
> then intersect (AND) in memory. try, it may be faster than the
> sql-joins.

Or take a look at couchdb-lucene which does allow these kinds of queries (and more):

View raw message