Eusebiu Marcu
Eusebiu Marcu

Reputation: 320

Cloudant geo search query with timestamp sorting

I have a database of geospatial documents (type: 'Feature' & geometry:...) with a 'date' field as a timestamp (created time). What is the best way sort the documents by 'date' timestamp?

Looking at the docs - https://console.bluemix.net/docs/services/Cloudant/api/cloudant-geo.html#querying-a-cloudant-geo-index, there is no 'sort' parameter to the .geo() query object. Is the 'in memory' the only way?

Upvotes: 1

Views: 261

Answers (1)

Raj
Raj

Reputation: 544

You are correct. There's no way to sort when using the geo index. If you want to do that, you can use Lucene geo as described in this blog post, but the spatial part will be limited to bounding box queries.

Upvotes: 0

Related Questions