func (c *Client) CreateIndex(index *Index) error {
	span := c.tracer.StartSpan("Client.CreateIndex")
	defer span.Finish()

	data := []byte(index.options.String())
	path := fmt.Sprintf("/index/%s", index.name)
	response, _, err := c.httpRequest("POST", path, data, nil, false)
	if err != nil {
		if response != nil && response.StatusCode == 409 {
			return ErrIndexExists
		}
		return err
	}
	return nil

}
func (c *Client) CreateIndex(index *Index) error {
	span := c.tracer.StartSpan("Client.CreateIndex")
	defer span.Finish()

	data := []byte(index.options.String())
	path := fmt.Sprintf("/index/%s", index.name)
	response, _, err := c.httpRequest("POST", path, data, nil, false)
	if err != nil {
		if response != nil && response.StatusCode == 409 {
			return ErrIndexExists
		}
		return err
	}
	return nil

}
func ( c * Client ) CreateIndex ( index * Index ) error { span := c . tracer . StartSpan ( " " ) defer span . Finish ( ) data := [ ] byte ( index . options . String ( ) ) path := fmt . Sprintf ( " " , index . name ) response , _ , err := c . httpRequest ( " " , path , data , nil , false ) if err != nil { if response != nil && response . StatusCode == 409 { return ErrIndexExists } return err } return nil }
// CreateIndex creates an index on the server using the given Index struct.
CreateIndex creates an index on the server using the given Index struct .