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 F08D6D287 for ; Tue, 16 Oct 2012 18:45:06 +0000 (UTC) Received: (qmail 97001 invoked by uid 500); 16 Oct 2012 18:45:06 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 96962 invoked by uid 500); 16 Oct 2012 18:45:06 -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 Received: (qmail 96954 invoked by uid 99); 16 Oct 2012 18:45:06 -0000 Received: from minotaur.apache.org (HELO minotaur.apache.org) (140.211.11.9) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Oct 2012 18:45:06 +0000 Received: from localhost (HELO mail-vb0-f52.google.com) (127.0.0.1) (smtp-auth username rnewson, mechanism plain) by minotaur.apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Oct 2012 18:45:06 +0000 Received: by mail-vb0-f52.google.com with SMTP id k17so6504200vbj.11 for ; Tue, 16 Oct 2012 11:45:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.74.97 with SMTP id s1mr7463469vdv.100.1350412794290; Tue, 16 Oct 2012 11:39:54 -0700 (PDT) Received: by 10.52.21.17 with HTTP; Tue, 16 Oct 2012 11:39:54 -0700 (PDT) In-Reply-To: References: <1350381017142-7581297.post@n2.nabble.com> Date: Tue, 16 Oct 2012 14:39:54 -0400 Message-ID: Subject: Re: (Dynamically) excluding documents from a view query From: Robert Newson To: dev@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I think that would require you to read the entire view every time, though. On 16 October 2012 10:53, boazc wrote: > Thanks Robert. > > It crossed my mind that I can use List function and expect say include-ke= ys > 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=3Da and ?key=3Db, 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=3Da but not tag=3Db I expect to get only d= oc3. >> > >> > 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 syst= em >> 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-d= ocuments-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 discussio= n >> below: >> >> http://couchdb-development.1959287.n2.nabble.com/Dynamically-excluding-d= ocuments-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.nabbl= e.com/Dynamically-excluding-documents-from-a-view-query-tp7581297p7581301.h= tml > Sent from the CouchDB Development mailing list archive at Nabble.com.