From user-return-15517-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Tue Mar 29 18:39:53 2011 Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 29923 invoked from network); 29 Mar 2011 18:39:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 29 Mar 2011 18:39:53 -0000 Received: (qmail 63319 invoked by uid 500); 29 Mar 2011 18:39:51 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 63280 invoked by uid 500); 29 Mar 2011 18:39:51 -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 63272 invoked by uid 99); 29 Mar 2011 18:39:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Mar 2011 18:39:51 +0000 X-ASF-Spam-Status: No, hits=-0.1 required=5.0 tests=HTML_FONT_SIZE_LARGE,HTML_MESSAGE,RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of prvs=4069202764=wcmclen@sandia.gov designates 132.175.109.17 as permitted sender) Received: from [132.175.109.17] (HELO sentry-three.sandia.gov) (132.175.109.17) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Mar 2011 18:39:42 +0000 X-WSS-ID: 0LIU15I-0C-CRU-02 X-M-MSG: Received: from sentry.sandia.gov (mm03snlnto.sandia.gov [132.175.109.20]) by sentry-three.sandia.gov (Postfix) with ESMTP id 129E34FE229 for ; Tue, 29 Mar 2011 12:39:17 -0600 (MDT) Received: from [134.253.103.2] by sentry.sandia.gov with ESMTP (SMTP Relay 01 (Email Firewall v6.3.2)); Tue, 29 Mar 2011 12:39:11 -0600 X-Server-Uuid: 6BFC7783-7E22-49B4-B610-66D6BE496C0E Received: from EXMB04.srn.sandia.gov ([169.254.4.133]) by EXCH02.srn.sandia.gov ([134.253.103.2]) with mapi id 14.01.0270.001; Tue, 29 Mar 2011 12:39:11 -0600 From: "Mclendon, William C III" To: "user@couchdb.apache.org" Subject: Querying a view with a complex key with a wildcard Thread-Topic: Querying a view with a complex key with a wildcard Thread-Index: AQHL7kCYQJrEZ7cxtE2tY8UdSgFMBg== Date: Tue, 29 Mar 2011 18:39:10 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.2.0.101115 x-originating-ip: [134.253.95.171] MIME-Version: 1.0 X-TMWD-Spam-Summary: TS=20110329183912; ID=1; SEV=2.3.1; DFV=B2011032919; IFV=NA; AIF=B2011032919; RPD=5.03.0010; ENG=NA; RPDID=7374723D303030312E30413031303230372E34443932323735312E303032332C73733D312C6667733D30; CAT=NONE; CON=NONE; SIG=AAAAAAAAAAAAAAAAAAAAAAAAfQ== X-MMS-Spam-Filter-ID: B2011032919_5.03.0010 X-WSS-ID: 618CF8C52PC2664628-01-01 Content-Type: multipart/alternative; boundary=_000_C9B7836E6C2Ewcmclensandiagov_ --_000_C9B7836E6C2Ewcmclensandiagov_ Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Hi, I've got a view that is built from a map.js that looks like this: function(doc) { if(doc['record type']=3D=3D'search') { emit( [doc.status, doc.time], doc ) } } Where the doc.status field is a string that is either "Running" or "Finishe= d" and doc.time is a floating point value from 0 and up representing the ti= me a task took to complete. I'd like to be able to query the documents that are 'Finished' and sort by = time. This query works: ... /_view/searches_by_status?startkey=3D["Finished",0]&include_docs=3Dtrue But it doesn't sort=85 So if I change it to: ... /_view/searches_by_status?startkey=3D["Finished",0]&include_docs=3Dtrue= &descending=3Dtrue Then I only get values containing time=3D0 Why does adding the descending=3Dtrue option change the results? I've also tried this: =85 /_view/searches_by_status?startkey=3D["Finished",0]&endkey=3D["Finished= ",9999.9999]&include_docs=3Dtrue&descending=3Dtrue But this one doesn't return anything. Is there a way to query this view to get records with a particular value in= the doc.status field and still sort the fields? Thanks in advance for any advice and/or help! -William --_000_C9B7836E6C2Ewcmclensandiagov_--