Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
12-30-2021 02:35 AM
With spacial functions and point
, it's easy to think about a graph DB for modeling a recommendations engine based on geographic location (lat,long). My questions are around - what is the standard of modeling such a system - is it as easy as I think or are there more gotcha's in terms of performance.
The standard model that comes to mind is:
(n: Business) (m: Business) (...: Business)
Business:
- Name
- Latitude, Longitude
For a search, simply get a cartesian product as follows:
MATCH (a:Business)
WHERE distance(a.location, Point({latitude:$input_lat, longitude:$input_long})) < $distance_in_meters
RETURN a
This incurs a label scan based on location. We can probably index the location and make this faster but I am wondering if this is the right way to model this data set?
Are there further optimizations by:
This is probably a case of premature optimization but I am wondering if the standard model above where location is a property on a Business node is the right way to achieve the above or is there anything else?
Thanks for your help.
All the sessions of the conference are now available online