I'm having this issue where I need my index to look like this:
"status": {
"type": "keyword",
}
I create my Java class:
@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;
}
But spring creates the index as follows:
"status": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
How can I make the keyword type the main type instead text?