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
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