Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 50905 invoked from network); 5 Jun 2010 12:12:25 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 5 Jun 2010 12:12:25 -0000 Received: (qmail 44859 invoked by uid 500); 5 Jun 2010 12:12:23 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 44692 invoked by uid 500); 5 Jun 2010 12:12:23 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 44684 invoked by uid 99); 5 Jun 2010 12:12:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 05 Jun 2010 12:12:22 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of bchesneau@gmail.com designates 74.125.83.180 as permitted sender) Received: from [74.125.83.180] (HELO mail-pv0-f180.google.com) (74.125.83.180) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 05 Jun 2010 12:12:16 +0000 Received: by pvg7 with SMTP id 7so1396455pvg.11 for ; Sat, 05 Jun 2010 05:11:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=PC88uMcPcbRZqVsSHd7RDah2WgVCTiJeneRWr+hrfYg=; b=bTQldY37Saixb02z/vm2OQV5vFL1gXD5SicDZP8EmI1/JPCJWbpQJTolv7BtmHo8+h qlRjTyPz8UmvsZM3KtKCzdfHeIdQfaY+BrtoPolgwl9jeZ+VoqPe53TtGIYt+qLL+Dv1 hjTE4sGY2dWIhGmpdGf0sgOxSLuEWlMP5xPfo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=Qzb+jQ/AgtaB/+4m38dB9YidO8I2nKpFnYDJ3WDEUAOM4UmcaqoYU1FCZgmd2f5cvD 9/olZejh6zhQI3uVojPsYyp2NFrl10euNLKI7SroPnEAKDgFoiJb4rjv8yADthjJF556 vRAoW3jooJm1BPE4/BrnunYCNqEM/GpWRmTaE= MIME-Version: 1.0 Received: by 10.141.187.3 with SMTP id o3mr9929722rvp.224.1275739914626; Sat, 05 Jun 2010 05:11:54 -0700 (PDT) Received: by 10.141.27.20 with HTTP; Sat, 5 Jun 2010 05:11:54 -0700 (PDT) In-Reply-To: References: <32D81ADB-311F-43E3-94A7-A4BEBF6A3D4C@utt.fr> Date: Sat, 5 Jun 2010 14:11:54 +0200 Message-ID: Subject: Re: Rewriting a parameterized URL From: Benoit Chesneau To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org On Sat, Jun 5, 2010 at 1:53 PM, Aur=E9lien B=E9nel = wrote: >> Oh what you would like is : >> [ >> { >> =A0"from": "/item", >> =A0"to": "_list/mapping/kwic", >> =A0"query": { >> =A0 =A0"startkey": [":corpus"], >> =A0 =A0"endkey": [":corpus",{}] >> =A0} >> } >> ] >> and just pass corpus=3Dcorpus as argument in your client url : /item?cor= pus=3D ... > > > Thank you for your advice. However i got: > > 1> [debug] [<0.21204.0>] 'GET' /cassandre/_design/cassandre/_rewrite/item= ?corpus=3DMISS {1,1} > [snip] > 1> [debug] [<0.21204.0>] rewrite to "/cassandre/_design/cassandre/_list/m= apping/kwic?startkey=3D%5B%22%3Acorpus%22%5D&endkey=3D%5B%22%3Acorpus%22%2C= %7B%7D%5D&corpus=3DMISS" > > While i wanted it to be rewritten to: > "/cassandre/_design/cassandre/_list/mapping/kwic?startkey=3D%5B%22MISS%22= %5D&endkey=3D%5B%22MISS%22%2C%7B%7D%5D > > In other words, it seems that it doesn't understand anymore that :corpus = is a variable which is instantiated to "MISS". > > Any further idea? > > > Regards, > > Aur=E9lien > > > Original post: > >> Hi there, >> >> I am now trying to rewrite URLs... >> >> With a nightly build of CouchDB (to fix COUCHDB-677 issue), I successful= ly used this rewrite rule: >> [ >> { >> =A0 "from": "/item/:corpus", >> =A0 "to": "_list/mapping/kwic", >> =A0 "query": { >> =A0 =A0 "startkey": [":corpus"], >> =A0 =A0 "endkey": [":corpus",{}] >> =A0 } >> } >> ] >> >> However in order to implement the given specification, I would need some= thing like this rule: >> [ >> { >> =A0 "from": "/item/?corpus=3D:corpus", >> =A0 "to": "_list/mapping/kwic", >> =A0 "query": { >> =A0 =A0 "startkey": [":corpus"], >> =A0 =A0 "endkey": [":corpus",{}] >> =A0 } >> } >> ] >> >> I get: >> 1> [debug] [<0.3235.0>] 'GET' /cassandre/_design/cassandre/_rewrite/item= /?corpus=3DMISS {1,1} >> [snip] >> 1> [debug] [<0.3235.0>] OAuth Params: [{"corpus","MISS"}] >> [snip] >> 1> [debug] [<0.3235.0>] httpd 404 error response: >> {"error":"not_found","reason":"missing"} >> >> Any idea of what should be done so that my parameters are not interprete= d as OAuth parameters and so that they are sent to my rewrite rule instead? >> >> >> Regards, >> >> Aur=E9lien > remove the ":corpus" in rule and just use :corpus. Think it would work. If in the same ytime you could open a ticket ? I will try to fix it during the week-end . - benoit