【店小二】公告:
| | |
功能介绍
1.将
mapping
中的properties
内容转为struct
2.注意是将properties
值作为输入内容, 如下:
{
"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"
}
}
}
}
示例
{
"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"
}
}
处理后
type GenerateObj struct {
DocId string `json:"doc_id,omitempty"`
Id int64 `json:"id,omitempty"`
Path string `json:"path,omitempty"`
Name string `json:"name,omitempty"`
Url string `json:"url,omitempty"`
Description string `json:"description,omitempty"`
CreatedTime string `json:"created_time,omitempty"`
}