The free online ES to Java tool quickly converts Elasticsearch document structures into Java entity classes. Support field mapping, automatic type conversion, and code generation to improve development efficiency.
使用说明
feature introduction
- Change the contents of
propertiesinmappingtostruct, as follows
{
"mappings": {
"properties": {
"doc_id": {
"type": "keyword"
},
"id": {
"type": "long"
},
"path": {
"type": "keyword"
},
"name": {
"type": "text"
},
"url": {
"type": "keyword"
},
"description": {
"type": "text"
},
"created_time": {
"type": "date",
"format": "yyyy-MM-dd HH:mm:ss"
}
}
}
}
After treatment
public class Es2StructTmp {
private String created_time;
private String description;
private String doc_id;
private Integer id;
private String name;
private String path;
private String url;
public String getCreated_time() {
return this.created_time;
}
public void setCreated_time(String created_time) {
this.created_time = created_time;
}
public String getDescription() {
return this.description;
}
public void setDescription(String description) {
this.description = description;
}
public String getDoc_id() {
return this.doc_id;
}
public void setDoc_id(String doc_id) {
this.doc_id = doc_id;
}
public Integer getId() {
return this.id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public String getPath() {
return this.path;
}
public void setPath(String path) {
this.path = path;
}
public String getUrl() {
return this.url;
}
public void setUrl(String url) {
this.url = url;
}
}