根据id查询文档,并创建索引
(id int)
| 328 | |
| 329 | //根据id查询文档,并创建索引 |
| 330 | func (this *ElasticSearchClient) BuildIndexById(id int) (err error) { |
| 331 | if es, errES := NewDocument().GetDocForElasticSearch(id); errES != nil { |
| 332 | err = errES |
| 333 | } else { |
| 334 | //基本只会有一项 |
| 335 | for _, item := range es { |
| 336 | err = this.BuildIndex(item) |
| 337 | } |
| 338 | } |
| 339 | return |
| 340 | } |
| 341 | |
| 342 | //通过bulk,批量创建/更新索引 |
| 343 | func (this *ElasticSearchClient) BuildIndexByBuck(data []ElasticSearchData) (err error) { |
no test coverage detected