Suppose there are some POJOs to be written to an Elasticsearch index. From my limited experience with ES, each field gets a type (e.g. text, keyword, ...). Is it possible to configure the Jackson ObjectMapper with the annotations from spring-data-elasticsearch to customize the type of the serialized Json? As an example:
@Document(indexName = "books", type = "book")
public class Book {
@Id
@Field(type = FieldType.Keyword)
String isbn;
@Field(type = FieldType.Text)
String title;
}
Then the mapping should include something like
{
"mappings":
{
"book": {
"properties": {
"id": {
"type": "keyword"
},
"title": {
"type": "text"
}
}
}
}
}
Please let me know if I think about this wrong!