couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ido Ran <ido....@gmail.com>
Subject Re: "IN" SQL Clause in Couch View
Date Wed, 15 Sep 2010 09:30:30 GMT
I don't know the keywords apriori so I can't create view for each keyword.
Also it sound like very complicated solution to what look like simple
problem.

I've found this post
http://www.vertigrated.com/blog/2010/04/where-clauses-like-selects-against-couchdb/
on
how to create selective where. It is still pretty complex and he use both
view as well as List Function so I need to see how evently will handle List
Function - I know evently can retrieve a view but I don't know about List
Function.

Thank you all for the answers,
Ido

On Wed, Sep 15, 2010 at 1:03 AM, Norman Barker <norman.barker@gmail.com>wrote:

> Hi,
>
> you could use the multiview for this;
>
> so have a single view that emits each of the keywords as a key
>
> and then the multiview will calculate on the server the intersection
> of two views (e.g. view one would be keyed on blue, view two would be
> keyed on dog), the multiview would only return the documents with both
> keys.
>
> More details here
>
> http://github.com/normanb/couchdb
>
> and I would really like some feedback on this!
>
> thanks,
>
> Norman
>
> On Tue, Sep 14, 2010 at 2:07 PM, Nils Breunese <N.Breunese@vpro.nl> wrote:
> > You'll need to get the documents containing "Blue" and the documents
> containing "Cat" and let the client do the intersection. Or add
> couchdb-lucene to the mix, which offers full-text indexing:
> http://github.com/rnewson/couchdb-lucene
> >
> > Nils.
> > ________________________________________
> > Van: Ido Ran [ido.ran@gmail.com]
> > Verzonden: dinsdag 14 september 2010 22:05
> > Aan: CouchDB MailingList
> > Onderwerp: "IN" SQL Clause in Couch View
> >
> > Hi,
> > I am trying to create a view like the one exist in taskr application
> called
> > tag-cloud/
> > I want to be able to retrieve all documents which contain all the
> keywords I
> > specify.
> >
> > For example:
> > {
> >  _id: "A",
> >  keywords: ["Dog", "Cat", "Blue"]
> > }
> > {
> >  _id: "B",
> >  keywords: ["Dog", "Tree", "Blue"]
> > }
> >
> > Now, if I ask for documents with ["Dog"] I want to get both documents
> back.
> > If I ask for documents with ["Blue", "Cat"] I want to get document A only
> > because B does not have both Blue and Cat.
> > The order is not important to me.
> >
> > How can I go about it with CouchDB views?
> >
> > Thank you,
> > Ido
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message