MCPcopy Index your code
hub / github.com/TruthHun/DocHub / existIndex

Method existIndex

models/ElasticSearchModel.go:452–462  ·  view source on GitHub ↗

查询索引是否存在 @return err nil表示索引存在,否则表示不存在

()

Source from the content-addressed store, hash-verified

450//查询索引是否存在
451//@return err nil表示索引存在,否则表示不存在
452func (this *ElasticSearchClient) existIndex() (err error) {
453 var resp *http.Response
454 api := this.Host + this.Index
455 if resp, err = this.get(api).Response(); err == nil {
456 if resp.StatusCode >= 300 || resp.StatusCode < 200 {
457 b, _ := ioutil.ReadAll(resp.Body)
458 err = errors.New(resp.Status + ":" + string(b))
459 }
460 }
461 return
462}
463
464//创建索引
465//@return err 创建索引

Callers 1

InitMethod · 0.95

Calls 2

getMethod · 0.95
ResponseMethod · 0.80

Tested by

no test coverage detected