code: func (s *ExistsService) Do(ctx context.Context) (bool, error) {
  	// Check pre-conditions
  	if err := s.Validate(); err != nil {
  		return false, err
  	}
  
  	// Get URL for request
  	path, params, err := s.buildURL()
  	if err != nil {
  		return false, err
  	}
  
  	// Get HTTP response
  	res, err := s.client.PerformRequest(ctx, PerformRequestOptions{
  		Method:       "HEAD",
  		Path:         path,
  		Params:       params,
  		IgnoreErrors: []int{404},
  	})
  	if err != nil {
  		return false, err
  	}
  
  	// Return operation response
  	switch res.StatusCode {
  	case http.StatusOK:
  		return true, nil
  	case http.StatusNotFound:
  		return false, nil
  	default:
  		return false, fmt.Errorf("elastic: got HTTP code %d when it should have been either 200 or 404", res.StatusCode)
  	}
  }
docs: // Do executes the operation.