Guest User

Untitled

a guest
Aug 22nd, 2019
81
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. func (p *PostElastic) FindById(id string) (*esapi.Response, error) {
  2. req := esapi.GetRequest{Index: p.post.GetIndexName(), DocumentID: id}
  3.  
  4. res, err := req.Do(context.Background(), &p.Client)
  5.  
  6. if err != nil {
  7. return nil, err
  8. }
  9.  
  10. if res.IsError() {
  11. panic(res.Status())
  12. }
  13.  
  14. return res, nil
  15. }
RAW Paste Data