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 EE057DABA for ; Mon, 22 Oct 2012 12:43:56 +0000 (UTC) Received: (qmail 76250 invoked by uid 500); 22 Oct 2012 12:43:56 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 76196 invoked by uid 500); 22 Oct 2012 12:43:56 -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 71345 invoked by uid 99); 22 Oct 2012 11:22:37 -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 (athena.apache.org: 216.139.250.139 is neither permitted nor denied by domain of bcitrin@gmail.com) Date: Mon, 22 Oct 2012 04:22:11 -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_1875855_22512356.1350904931258" X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_1875855_22512356.1350904931258 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit I am playing with CouchDB-Lucene looking if it can fulfill my use-case. I see that I can only index one document at a time, i.e. I cannot create an index for each tag. What will be the approach here? Should I concatenate tags or is an array supported in Lucene? Thanks! On Tue, Oct 16, 2012 at 8:45 PM, Robert Newson-2 [via CouchDB Development] < ml-node+s1959287n7581303h58@n2.nabble.com> wrote: > I think that would require you to read the entire view every time, though. > > On 16 October 2012 10:53, boazc <[hidden email]> > wrote: > > > 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] < > > [hidden email] > > 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]< > http://user/SendEmail.jtp?type=node&node=7581300&i=0>> > >> 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< > http://couchdb-development.1959287.n2.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.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. > > > ------------------------------ > 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-tp7581297p7581303.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-tp7581297p7581329.html Sent from the CouchDB Development mailing list archive at Nabble.com. ------=_Part_1875855_22512356.1350904931258--