olivere / elastic

Deprecated: Use the official Elasticsearch client for Go at https://github.com/elastic/go-elasticsearch
https://olivere.github.io/elastic/
MIT License
7.39k stars 1.15k forks source link

the return value of add document #1680

Open Jerry-qmf opened 8 months ago

Jerry-qmf commented 8 months ago

Please use the following questions as a guideline to help me answer your issue/question without further inquiry. Thank you.

Which version of Elastic are you using?

[ ] elastic.v7 (for Elasticsearch v7.0.32)

resp, err := client.Index(). Index(esName). BodyJson(&esData). Do(context.Background())

this behavior is success, but the return value is resp=nil; err={"_index":"***","_type":"_doc","_id":"Oa_VC40B0i7qMU2vSM3a","_version":1,"result":"created","_shards":{"total":2,"successful":2,"failed":0},"_seq_no":8,"_primary_term":1}

I think this correct return value is: resp = {"_index":"***","_type":"_doc","_id":"Oa_VC40B0i7qMU2vSM3a","_version":1,"result":"created","_shards":{"total":2,"successful":2,"failed":0},"_seq_no":8,"_primary_term":1} err = nil