How to add custom name to elastic search using JEST client?
For Example Using Spring data You can use custom name. Spring Data ES use Jackson. So, you can use @JsonProperty("your_custom_name")
to enable custom name in ES Mapping
How to add custom name to elastic search using JEST client?
For Example Using Spring data You can use custom name. Spring Data ES use Jackson. So, you can use @JsonProperty("your_custom_name")
to enable custom name in ES Mapping
With jest client for elasticsearch, you need not specify any annotations for the field names. The variable name itself is used by jest client to write data into elasticsearch. For example :
class Article {
@JestId
private String documentId;
private String author;
private int pages;
}
Writing the above class will generate the documents with field names as documentId, author and pages.
{
"documentId" : "doc_01",
"author" : "John Doe",
"pages" : 3
}