Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 70379DB52 for ; Fri, 17 May 2013 12:35:43 +0000 (UTC) Received: (qmail 51285 invoked by uid 500); 17 May 2013 12:35:42 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 51097 invoked by uid 500); 17 May 2013 12:35:41 -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 51078 invoked by uid 99); 17 May 2013 12:35:41 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 May 2013 12:35:41 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of volker.mische@gmail.com designates 209.85.215.176 as permitted sender) Received: from [209.85.215.176] (HELO mail-ea0-f176.google.com) (209.85.215.176) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 May 2013 12:35:35 +0000 Received: by mail-ea0-f176.google.com with SMTP id k11so2388899eaj.35 for ; Fri, 17 May 2013 05:35:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=QpLZ1ezFCS6itALUhzEMiMXqjD/LBsAvdpkpJ4IddPQ=; b=U92C6LHb9oqIWE2+XUAGuK87ANbyIpJBrZQNUj34s3Eh61wI463dkkc8xkqvqWFfJi T6FFB9VtAjEFuVbTHXTKcfKSUdwEwpStq/BTJ/ew7PheoJedYKNWzgcrIu3LtBI+lXuV Jn9g2LoRulGhAonuVZsiKrpuUWSCNGuQfOyRnolJdd4DFmB2xMm6hckdE5vrBJppGPGt GPwQECGgKSsPgeQMsIYkCAKw9HIJBbt7zuLZNjIWM6t8RwmmWyWMk1QajE3IRQ0zac3J nw9SMSsKfi8fvzfZs55Uc6wRi13Gcy53wp8/LjwGlzp73uhY4lQHZampdFkwmtb4/JgI Yy4g== X-Received: by 10.15.108.141 with SMTP id cd13mr15316848eeb.46.1368794114644; Fri, 17 May 2013 05:35:14 -0700 (PDT) Received: from [192.168.0.6] (dslb-084-056-041-181.pools.arcor-ip.net. [84.56.41.181]) by mx.google.com with ESMTPSA id i2sm18459403eeg.2.2013.05.17.05.35.12 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 17 May 2013 05:35:13 -0700 (PDT) Message-ID: <519623E5.9020403@gmail.com> Date: Fri, 17 May 2013 14:34:45 +0200 From: Volker Mische User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12 MIME-Version: 1.0 To: user@couchdb.apache.org CC: Chris Costakes Subject: Re: Spacial search with GeoCouch References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On 05/17/2013 02:12 PM, Chris Costakes wrote: > Using CouchDB (and GeoCouch), I have a document type of Location with a > center coordinate (lat & long). I am able to query with a bbox query just > fine by feeding in a northwest longitude/latitude and a southwest > longitude/latitued. My location doc also has an attribute called Users > where I have an array of user id's. I would like to be able to perform a > bbox with the addition of filtering by a specific user in the Users array. > Is this possible? > > The reason important is because I may have millions of different location > documents, each with a list of users in the User array (maybe hundreds of > user tags per location). I'm trying to find a list of locations for a group > of users. So I have 3 users for a particular search and I want to find all > of the locations for these users within a given boundry. The only way I can > think to handle this scenario is to perform the bbox spatial query first > and then loop through the result set to determine if the user matches the > list of the 3 users. This would mean looping through a potentially very > large original result set (the list of locations). Would love to add an > additional dimension to my bbox query to filter also by user, but I can't > figure out how to accomplish this or whether it is possible. Thank you! Hi Chris, you currently can't query for another attribute. You could also try a _list function [1], it would then be handled on the server side and not transfer all the data to the client side. [1] https://couchdb.readthedocs.org/en/latest/ddocs.html#list-functions Cheers, Volker