couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Volker Mische <volker.mis...@gmail.com>
Subject Re: Spacial search with GeoCouch
Date Fri, 17 May 2013 12:34:45 GMT
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

Mime
View raw message