Skip to main content

Posts

Showing posts with the label bounding box

How to Speed Up Spatial Search in Couchbase N1QL

Location-based services like  Yelp ,  Uber , and  Foursquare  are ubiquitous. This article shows an easy way to use Couchbase N1QL to issue spatial queries and use GSI index to speed up those queries to meet your SLAs. Whether you just finished a long SF Giants extra innings win or spent the afternoon running up and down the Lombard Street in San Francisco, sometimes, you just want a cold one, really fast. When you search on your app, you expect the answer quickly, with ratings, distance, and all. Thanks to  GPS ,  triangulation , and  IP-based location detection , apps can determine your current  location . Google does this. Yelp does this. Uber does this. How can you use your spatial data to provide location-based services or information? Here is an example of spatial data for two breweries from the beer-sample data set shipped with Couchbase. { "geo" : { "accuracy" : "ROOFTOP" , ...