couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anand Chitipothu <anandol...@gmail.com>
Subject Re: the feature of my dream
Date Sat, 19 Feb 2011 15:32:30 GMT
2011/2/17  <mickael.bailly@free.fr>:
>
> Hello devs,
>
> I hope this thread will bring some interesting ideas. Using Couch for a few years now,
there is one feature I think would add great powerb. Note that any new function name/query
option name I use is only to explain my point.
>
> So let's say I have a design doc "foo" with a "bar" map function being :
>
> function(doc) {
>        emitIndexedObject({color: "blue", shape: "circle", active: true},null);
>        emitIndexedObject({color: "blue", shape: "circle", active: false},null);
>        emitIndexedObject({color: "red", shape: "circle", active: false},null);
> }
>
> (of course static values in this example would certainly, in real life, be issued from
the "doc")
>
> Then I can query this view like :
>
> /_design/foo/_view/bar?indexes={active:true}
> =>
> {
> total_rows: ...,
> offset: ...,
> rows:
> [
>        {
>                id: ...,
>                key: {color: "blue", shape: "circle", active: true},
>                value: ...
>        }
> ]
> }
>
> /_design/foo/_view/bar?indexes={color:"blue"}
> =>
> {
> total_rows: ...,
> offset: ...,
> rows:
> [
>        {
>                id: ...,
>                key: {color: "blue", shape: "circle", active: true},
>                value: ...
>        },
>        {
>                id: ...,
>                key: {color: "blue", shape: "circle", active: false},
>                value: ...
>        }
> ]
> }
>
> /_design/foo/_view/bar?indexes={color:"blue",active:false}
> =>
> {
> total_rows: ...,
> offset: ...,
> rows:
> [
>        {
>                id: ...,
>                key: {color: "blue", shape: "circle", active: false},
>                value: ...
>        }
> ]
> }
>
> Hope you get the idea.
>
> What are your thoughts on this ?

Use couchdb-lucene.

https://github.com/rnewson/couchdb-lucene/

Anand

Mime
View raw message