【发布时间】:2019-12-05 09:06:41
【问题描述】:
我使用 Spring Boot 2.0.1.RELEASE/Spring Data Elasticsearch 3.0.6。 我用@Document 注释注释了我的域类,并且我有一个如下字段:
@Field(store = true, type = FieldType.?)
private String ipRange;
如您所见,我需要将字段类型设置为 IP_Range(存在于弹性搜索引擎数据类型中) 但在 FieldType 枚举中不存在。
我想通过 ElasticsearchTemplate.createIndex(doc) 方法创建这个文档索引。但没有任何 FieldType 枚举支持 ip_range 数据类型。
【问题讨论】:
标签: spring-boot spring-data spring-data-elasticsearch elasticsearch-6 custom-data-type