Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 57506 invoked from network); 12 Apr 2010 08:26:05 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 12 Apr 2010 08:26:05 -0000 Received: (qmail 92788 invoked by uid 500); 12 Apr 2010 08:26:04 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 92700 invoked by uid 500); 12 Apr 2010 08:26:04 -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 92692 invoked by uid 99); 12 Apr 2010 08:26:03 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Apr 2010 08:26:03 +0000 X-ASF-Spam-Status: No, hits=-1.0 required=10.0 tests=AWL,RCVD_IN_DNSWL_NONE X-Spam-Check-By: apache.org Received-SPF: unknown (athena.apache.org: error in processing during lookup of magnus@magnusottosson.se) Received: from [72.14.220.157] (HELO fg-out-1718.google.com) (72.14.220.157) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Apr 2010 08:25:57 +0000 Received: by fg-out-1718.google.com with SMTP id d23so2284957fga.5 for ; Mon, 12 Apr 2010 01:25:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.112.148 with HTTP; Mon, 12 Apr 2010 01:25:36 -0700 (PDT) Date: Mon, 12 Apr 2010 10:25:36 +0200 Received: by 10.223.63.17 with SMTP id z17mr2405775fah.66.1271060736369; Mon, 12 Apr 2010 01:25:36 -0700 (PDT) Message-ID: Subject: Search for city by name, order by population From: Magnus Ottosson To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 Hi, I have a database with the names and population of cities (about 7 million entities). Is it possible, with couchdb, to create a key that includes both cityname and population where I can search for a name and get the matching results ordered by the population? I tried to create a key like [population, name] and search like this ?startkey=[0, "name"]&endkey=[10000000, "name]&limit=10 but it does not work like the way I hoped. Any ideas? Magnus