couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From boazc <bcit...@gmail.com>
Subject Re: (Dynamically) excluding documents from a view query
Date Tue, 16 Oct 2012 14:53:45 GMT
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]<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<http://couchdb-development.1959287.n2.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=7581297&code=YmNpdHJpbkBnbWFpbC5jb218NzU4MTI5N3wtMTkyNTAwODYwOA==>
> .
> 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.
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message