incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nils Breunese <N.Breun...@vpro.nl>
Subject Re: request with OR conditions
Date Tue, 11 Dec 2012 09:31:56 GMT
svilen <az@svilendobrev.com> 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): https://github.com/rnewson/couchdb-lucene

Nils.
Mime
View raw message