【问题标题】:what is the equivalent data type for geo_point in hibernate search?休眠搜索中 geo_point 的等效数据类型是什么?
【发布时间】:2017-08-21 13:24:59
【问题描述】:

我正在使用弹性搜索和休眠搜索。我想将一种属性数据类型设为 geo_point ,这样我就可以使用 kibana 绘制瓦片地图。在弹性搜索中的 geo_point 的休眠搜索中是否有任何等效的数据类型?

【问题讨论】:

    标签: elasticsearch hibernate-search


    【解决方案1】:

    您可以使用 Hibernate Search 的空间功能:

    import org.hibernate.search.annotations.*;
    
    @Entity
    @Indexed
    @Spatial
    public class Hotel {
    
      @Latitude
      Double latitude
    
      @Longitude
      Double longitude
    
      // ...
    }
    

    您最终会在文档中得到一个名为 locationgeo_point 字段。

    欲了解更多信息:https://docs.jboss.org/hibernate/stable/search/reference/en-US/html_single/#spatial

    【讨论】:

    • 嗨 Yoann,我正在使用空间注释,但低于异常。 org.hibernate.search.engine.metadata.impl.TypeMetadata$Builder.getAnalyzerReference(TypeMetadata.java:631)。有什么建议吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-04-08
    • 1970-01-01
    • 2021-08-30
    • 1970-01-01
    相关资源
    最近更新 更多