【发布时间】:2017-08-21 13:24:59
【问题描述】:
我正在使用弹性搜索和休眠搜索。我想将一种属性数据类型设为 geo_point ,这样我就可以使用 kibana 绘制瓦片地图。在弹性搜索中的 geo_point 的休眠搜索中是否有任何等效的数据类型?
【问题讨论】:
标签: elasticsearch hibernate-search
我正在使用弹性搜索和休眠搜索。我想将一种属性数据类型设为 geo_point ,这样我就可以使用 kibana 绘制瓦片地图。在弹性搜索中的 geo_point 的休眠搜索中是否有任何等效的数据类型?
【问题讨论】:
标签: elasticsearch hibernate-search
您可以使用 Hibernate Search 的空间功能:
import org.hibernate.search.annotations.*;
@Entity
@Indexed
@Spatial
public class Hotel {
@Latitude
Double latitude
@Longitude
Double longitude
// ...
}
您最终会在文档中得到一个名为 location 的 geo_point 字段。
欲了解更多信息:https://docs.jboss.org/hibernate/stable/search/reference/en-US/html_single/#spatial
【讨论】: