我有一个问题,我需要我的索引像这样:
"status": {
"type": "keyword",
}
我创建java类:
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_ABSENT)
@Document(indexName = "#{applicationConfiguration.indexName}")
public class ProductDocument {
@Field(type = FieldType.Keyword)
@NotEmpty
@JsonProperty("status")
private String status;
}
但是spring创建的索引如下:
"status": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
如何使关键字类型成为主类型而不是文本?
暂无答案!
目前还没有任何答案,快来回答吧!