I have changed my code so that it uses olivere package when inserting data into elastic search. This is the code
// Get a snapshot of stats (always blank if not enabled--see above)
stats := p.Stats()
fmt.Printf("Number of times flush has been invoked: %d
", stats.Flushed)
fmt.Printf("Number of times workers committed reqs: %d
", stats.Committed)
fmt.Printf("Number of requests indexed : %d
", stats.Indexed)
fmt.Printf("Number of requests reported as created: %d
", stats.Created)
fmt.Printf("Number of requests reported as updated: %d
", stats.Updated)
fmt.Printf("Number of requests reported as success: %d
", stats.Succeeded)
fmt.Printf("Number of requests reported as failed : %d
", stats.Failed)
This is the log that I got
Number of times flush has been invoked: 1
Number of times workers committed reqs: 0
Number of requests indexed : 0
Number of requests reported as created: 0
Number of requests reported as updated: 0
Number of requests reported as success: 0
Number of requests reported as failed : 0
I don't know why the result is 0. I am not sure how to find where the error is. Does anyone know how to find the error?