Comments (1)
Find rooms within a 100 meter radius of a coordinate:
LET co = GEO_POINT(13.45477, 52.51171)
FOR doc IN arangobnb
SEARCH ANALYZER(GEO_DISTANCE(doc.location, co) < 100, "geo")
LET distance = GEO_DISTANCE(doc.location, co)
// Note: Web UI map view is triggered by presence of `geometry` attribute!
RETURN MERGE(KEEP(doc, "name", "_key"), {distance, geometry: location})
Search listing locations within a rectangle:
LET rect = GEO_POLYGON([ [13.4, 52.4], [13.5, 52.4], [13.5, 52.45], [13.4, 52.45], [13.4, 52.4] ])
LET results = (
FOR doc IN arangobnb
SEARCH ANALYZER(GEO_CONTAINS(rect, doc.location), "geo")
RETURN doc.location
)
// Hack to return the shape within we search as well
FOR r IN PUSH(results, rect)
RETURN r
Find private rooms within a rectangle that feature a hot tub, heating and Wi-Fi and cost between [30, 50] dollars:
LET rect = GEO_POLYGON([ [13.2, 52.6], [13.5, 52.6], [13.5, 52.45], [13.2, 52.45], [13.2, 52.6] ])
LET results = (
FOR doc IN arangobnb
SEARCH ANALYZER(GEO_CONTAINS(rect, doc.location), "geo") AND
doc.room_type == "Private room" /* identity analyzer */ AND
ANALYZER(TOKENS("tub heating wifi", "text_en") ALL IN doc.amenities, "text_en") AND
IN_RANGE(doc.price, 30, 50, true, true)
RETURN doc.location
)
FOR r IN PUSH(results, rect)
RETURN r
Pick a random neighborhood and find all listings in that polygon:
LET rect = FIRST(FOR n IN neighborhoods SORT RAND() LIMIT 1 RETURN n.geometry)
LET results = (
FOR doc IN arangobnb
SEARCH ANALYZER(GEO_CONTAINS(rect, doc.location), "geo")
RETURN doc.location
)
// Hack to return the shape within we search as well
FOR r IN PUSH(results, rect)
RETURN r
from arangobnb.
Related Issues (20)
- AQL: Natural Language Description Search HOT 1
- Frontend: Search Bar HOT 1
- Frontend: Filter Component HOT 1
- AQL: Filter Search HOT 5
- Frontend: Results Component HOT 1
- AQL: Dataset Modeling HOT 7
- Backend: KOA setup
- Backend: Foxx Microservice
- Project Structure HOT 3
- Backend: Reviews Language Data Modeling HOT 1
- Frontend: Map View HOT 2
- Frontend: AQL Query Display
- Documentation: Clarify which version of ArangoDB to use HOT 6
- Analyzer geo not found after importing dump HOT 3
- GeoCode Search is broken
- Frontend: Date functionality HOT 1
- Frontend: Guests Functionality
- Frontend: Theme & Background Hero Image HOT 3
- Backend: View Creation HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arangobnb.