On Sat, Jun 5, 2010 at 9:16 AM, Aurélien Bénel <[email protected]> wrote:
> Hi there,
>
> I am now trying to rewrite URLs...
>
> With a nightly build of CouchDB (to fix COUCHDB-677 issue), I successfully
> used this rewrite rule:
> [
> {
> "from": "/item/:corpus",
> "to": "_list/mapping/kwic",
> "query": {
> "startkey": [":corpus"],
> "endkey": [":corpus",{}]
> }
> }
> ]
>
> However in order to implement the given specification, I would need something
> like this rule:
> [
> {
> "from": "/item/?corpus=:corpus",
> "to": "_list/mapping/kwic",
> "query": {
> "startkey": [":corpus"],
> "endkey": [":corpus",{}]
> }
> }
> ]
Oh what you would like is :
[
{
"from": "/item",
"to": "_list/mapping/kwic",
"query": {
"startkey": [":corpus"],
"endkey": [":corpus",{}]
}
}
]
and just pass corpus=corpus as argument in your client url : /item?corpus= ...