Is it possible to query a geospatial index through related nodes with the 
lucene geospatial plugin? here is an example of what i'm trying to do.

Let's say you have a simple database with real estate agents and the houses 
they have shown over time. The db structure looks like this:

Vertices:
Agent (name, phone)
House (address, lat, long)

Edge:
showed_house (property: date_shown)

So, for example {#12:1 Rita} --showed_house(12/1/2014)--> {#13:1 1554 
Treeline Ave}
                                
Now, let's say I want to find all the houses that Rita has shown in the 
last week, along with the date they were shown, that are near the current 
user, Mark's, geolocation. For purposes of the example Mark's location is 
lat: 40.312233, long: -71.2555

This query does not seem to work:

select out_showed_house.in, $distance from #12:1 where 
[out_showed_house.in.latitude, out_showed_house.in.longitude, $spatial] 
near [40.312233, -71.2555, {"maxDistance":22}] 

However, if you turn it around, and do this query:

select from house where [house.latitude, house.longitude, $spatial] near 
[40.312233, -71.2555, {"maxDistance":22}] and #12:1 in in_showed_house.out

that query works fine.

I assume the reason for this is that the "from" clause of the query must be 
against the class where you created the index. 

Is there any way to make my first query work, so that I can pull only the 
related edges I want from the target vertex? (in the scenario that works, I 
have to pull all edges into each house, instead of only getting the 
vertices from the real estate agent i'm interested in).

Thanks,

Jonathan

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to