Return-Path: X-Original-To: apmail-couchdb-dev-archive@www.apache.org Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 99F57DE61 for ; Tue, 16 Oct 2012 15:52:04 +0000 (UTC) Received: (qmail 51758 invoked by uid 500); 16 Oct 2012 15:52:04 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 51693 invoked by uid 500); 16 Oct 2012 15:52:04 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Delivered-To: moderator for dev@couchdb.apache.org Received: (qmail 27330 invoked by uid 99); 16 Oct 2012 14:54:13 -0000 X-ASF-Spam-Status: No, hits=4.2 required=5.0 tests=HTML_MESSAGE,SPF_NEUTRAL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: 216.139.250.139 is neither permitted nor denied by domain of bcitrin@gmail.com) Date: Tue, 16 Oct 2012 07:53:45 -0700 (PDT) From: boazc To: dev@couchdb.apache.org Message-ID: In-Reply-To: References: <1350381017142-7581297.post@n2.nabble.com> Subject: Re: (Dynamically) excluding documents from a view query MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_673803_9466672.1350399225177" X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_673803_9466672.1350399225177 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Thanks Robert. It crossed my mind that I can use List function and expect say include-keys and exclude-keys query parameters thus filter out the undesired documents. 1. Do you think the performance of such function will be reasonable? 2. Can I still support pagination through a List function? Cheers. On Tue, Oct 16, 2012 at 3:30 PM, Robert Newson-2 [via CouchDB Development] < ml-node+s1959287n7581300h65@n2.nabble.com> wrote: > I can't speak about ElasticSearch, but the CouchDB-Lucene query would > certainly reflect the current state of your database (i.e, no "delay") > when you query. > > As for the original question, I don't think you can achieve it > directly with CouchDB views. If you emit each tag of a document as a > key, and null for value (e.g, emit("a",null)), then you could make two > concurrent queries for ?key=a and ?key=b, and read each, row by row, > filtering out as appropriate. It's not trivial. > > B. > > On 16 October 2012 05:50, boazc <[hidden email]> > wrote: > > > Hello, > > > > My documents contain tags which have a corresponding view. > > I want to retrieve all documents that contain a certain tag, but don't > > contain another one. > > (Note that I don't know about the possible tags in advance). > > > > Example: > > id: doc1, tags: [a, b] > > id: doc2, tags: [b, c] > > id: doc3, tags: [a, c] > > If I want all docs with tag=a but not tag=b I expect to get only doc3. > > > > Is there a way to achieve this on CouchDB side? > > Needless to say I cannot do it on the client side as I cannot benefit > from > > pagination and anyway might receive an extreme set of documents I need > to > > work on. > > > > I know I can turn to some search engines e.g. ElasticSearch or > > CouchDB-Lucene, but other than introducing a new component to the system > it > > also means an inherent delay between the "real" data and the indexed > data > > which in my domain is unacceptable. > > > > Thanks!! > > > > > > > > -- > > View this message in context: > http://couchdb-development.1959287.n2.nabble.com/Dynamically-excluding-documents-from-a-view-query-tp7581297.html > > Sent from the CouchDB Development mailing list archive at Nabble.com. > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > > http://couchdb-development.1959287.n2.nabble.com/Dynamically-excluding-documents-from-a-view-query-tp7581297p7581300.html > To unsubscribe from (Dynamically) excluding documents from a view query, click > here > . > NAML > -- View this message in context: http://couchdb-development.1959287.n2.nabble.com/Dynamically-excluding-documents-from-a-view-query-tp7581297p7581301.html Sent from the CouchDB Development mailing list archive at Nabble.com. ------=_Part_673803_9466672.1350399225177--