我试图使用cloudant的地理空间索引来搜索文档。此外,我一直在使用cloudant客户机,如下所示。但我找不到搜索文件的方法或样本。请救救我!
<dependency>
<groupId>com.cloudant</groupId>
<artifactId>cloudant-client</artifactId>
<version>2.12.0</version>
</dependency>这是地球空间指数。
_design/eventgeo
indexname:st_index
function (doc) {
if (doc.geometry && doc.geometry.coordinates) {
st_index(doc.geometry);
}
}我试着按下面的方式搜索这些文件。但我错了:
异常消息:在docs:true中找不到404对象。错误: not_found。原因:_geo没有找到..。
List<Event> events = this.database.search("eventgeo/_geo/st_index").limit(10).includeDocs(true)
.query("lat:" + latitude + " and lon:" + longitude + " and radius:" + 10000 + " and relation:contains"
+ " and include_docs:true", Event.class);发布于 2018-04-16 17:04:39
查看地理空间查询的Cloudant文档:https://console.bluemix.net/docs/services/Cloudant/api/cloudant-geo.html#cloudant-nosql-db-geospatial
您似乎在使用search端点:
_design/eventgeo/_search/_geo
我相信您希望使用地理空间索引API端点:
_design/eventgeo/_geo/geoidx
https://stackoverflow.com/questions/49860661
复制相似问题