Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1E7C9D1C9 for ; Tue, 11 Dec 2012 09:32:36 +0000 (UTC) Received: (qmail 7500 invoked by uid 500); 11 Dec 2012 09:32:34 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 7091 invoked by uid 500); 11 Dec 2012 09:32:34 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 7057 invoked by uid 99); 11 Dec 2012 09:32:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Dec 2012 09:32:33 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of N.Breunese@vpro.nl designates 145.58.30.184 as permitted sender) Received: from [145.58.30.184] (HELO out1a.mail.omroep.nl) (145.58.30.184) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Dec 2012 09:32:27 +0000 Received: from localhost (ou1aclean [10.10.30.156]) by out1a.mail.omroep.nl (Postfix MTA - NPO ICT) with ESMTP id 123EB800416 for ; Tue, 11 Dec 2012 10:32:06 +0100 (CET) X-Virus-Scanned: NPO ICT Received: from zeefje.vpro.nl (zeefje.vpro.nl [145.58.168.41]) by out1a.mail.omroep.nl (Postfix MTA - NPO ICT) with ESMTP id F07FB800411 for ; Tue, 11 Dec 2012 10:32:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=vpro.nl; i=@vpro.nl; q=dns/txt; s=a; t=1355218325; x=1418290325; h=from:to:date:subject:message-id:references:in-reply-to: content-transfer-encoding:mime-version; bh=4Ojitz62eOZ/HXqG0TZBnNClsaESokzkwfVQAvnEBG4=; b=XepWHU6GoW8fD71sw11JvUTns3KDSB6/FTXM5yTsbz20evlE521ScI4d cnzxuEjIqPWY3OpJJ6njwWjNJXoxxCwqnGQKq5+oefphzOL8I8omBHTYe oq5Ssz7eO0XCuYJsVOhyvsjgmjH4ZDf2ineKK7PdboLA3yiQuNrEpunTr o=; X-IronPort-AV: E=Sophos;i="4.84,258,1355094000"; d="scan'208";a="2702930" Received: from mail.vpro.nl ([145.58.171.81]) by zeefje.vpro.nl with ESMTP; 11 Dec 2012 10:31:57 +0100 Received: from VS-EX-01.intra.vpro.nl ([145.58.171.81]) by VS-EX-01.intra.vpro.nl ([145.58.171.81]) with mapi; Tue, 11 Dec 2012 10:31:57 +0100 From: Nils Breunese To: "user@couchdb.apache.org" Date: Tue, 11 Dec 2012 10:31:56 +0100 Subject: Re: request with OR conditions Thread-Topic: request with OR conditions Thread-Index: Ac3Xgly2AbhIcOBGSy+R1GyY4jOAhg== Message-ID: <102263D3-CB68-40A9-8FB8-5C7BFE78052E@vpro.nl> References: <20121207063826.GA43521@mail.ximad.com> <20121208091738.GA47811@mail.ximad.com> <20121208223006.4cdc9525@svilendobrev.com> In-Reply-To: <20121208223006.4cdc9525@svilendobrev.com> Accept-Language: nl-NL Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: nl-NL Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org svilen wrote: > {keys: list-of-keys} is an OR, not AND - {keys : [1,2]} means give=20 > items with key=3D1 OR key=3D2=20 > (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". >=20 > 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<=3Dn >=20 > 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 (a= nd more): https://github.com/rnewson/couchdb-lucene Nils.=