I put elastic5.SetTraceLog(log.New(os.Stdout, "Tracer ", log.LstdFlags)) option into ClientOptionFunc.
and I get the result and show the trace log ,but it mistaken code comes out.
Please describe the actual behavior
Any steps to reproduce the behavior?
indexs := []string{
"xxx-eventlog-2021",
"xxx-eventlog-2022",
}
svc := elastic5.NewScrollService(client.Instance()).
Index(indexs...).
Query(boolQuery).
Size(1)
pages := 0
numDocs := 0
for {
res, err := svc.Do(context.Background())
if err == io.EOF {
break
}
if err != nil {
fmt.Println(err)
}
if res == nil {
fmt.Println("expected results != nil; got nil")
}
if res.Hits == nil {
fmt.Println("expected results.Hits != nil; got nil")
}
pages++
for _, hit := range res.Hits.Hits {
item := make(map[string]interface{})
err := json.Unmarshal(*hit.Source, &item)
if err != nil {
fmt.Println(err)
}
numDocs++
}
}
Which version of Elastic are you using?
[ ] elastic.v7 (for Elasticsearch 7.x) [ ] elastic.v6 (for Elasticsearch 6.x) [√ ] elastic.v5 (for Elasticsearch 5.x) [ ] elastic.v3 (for Elasticsearch 2.x) [ ] elastic.v2 (for Elasticsearch 1.x)
Please describe the expected behavior
I put
elastic5.SetTraceLog(log.New(os.Stdout, "Tracer ", log.LstdFlags))
option into ClientOptionFunc. and I get the result and show the trace log ,but it mistaken code comes out.Please describe the actual behavior
Any steps to reproduce the behavior?