【发布时间】:2018-04-16 15:09:33
【问题描述】:
我正在尝试使用 cloudant 的地理空间索引搜索文档。 此外,我一直在使用 cloudant java 客户端,如下所示。 但我找不到搜索文档的方式或样本。 请帮帮我!!
<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);
}
}
我正在尝试搜索以下文档。但我得到错误:
异常消息:404 Object Not Found at https://??????.cloudant.com:443/events/_design/eventgeo/_search/_geo?limit=10&include_docs=true&q=lat:150.78688%20and%20lon:38.67915%20and%20radius:10000%20and%20relation:contains%20and%20include_docs:true。 错误:未找到。原因:_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);
【问题讨论】:
标签: java geospatial cloudant