func (c *JSONClient) AddCopyFields(ctx context.Context, collection string, copyFields ...CopyField) error {
	return c.modifySchema(ctx, collection, "add-copy-field", copyFields)
}
AddCopyFields adds new copy field rules to the schema.

Refer to https://solr.apache.org/guide/8_8/schema-api.html#add-a-new-copy-field-rule
package solr
import (
	"bytes"
	"context"
	"encoding/json"
	"fmt"
	"io"
	"io/ioutil"
	"net/http"
	"strings"
	"github.com/pkg/errors"
)
type JSONClient struct {
	baseURL string
	reqSender RequestSender
}
var _ Client = (*JSONClient)(nil)
func NewJSONClient(baseURL string) *JSONClient {
	return &JSONClient{
		baseURL:   baseURL,
		reqSender: NewDefaultRequestSender(),
	}
}
func (c *JSONClient) WithRequestSender(reqSender RequestSender) *JSONClient {
	c.reqSender = reqSender
	return c
}
func (c *JSONClient) CreateCollection(ctx context.Context, params *CollectionParams) error {
	urlStr := fmt.Sprintf("%s/solr/admin/collections?action=CREATE&"+params.BuildParams(), c.baseURL)
	httpResp, err := c.reqSender.SendRequest(ctx, http.MethodGet, urlStr, JSON.String(), nil)
	if err != nil {
		return errors.Wrap(err, "send request")
	}
	var resp BaseResponse
	err = readResponse(httpResp, &resp)
	if err != nil {
		return errors.Wrap(err, "read response")
	}
	return nil
}
func (c *JSONClient) DeleteCollection(ctx context.Context, params *CollectionParams) error {
	urlStr := fmt.Sprintf("%s/solr/admin/collections?action=DELETE&"+params.BuildParams(), c.baseURL)
	httpResp, err := c.reqSender.SendRequest(ctx, http.MethodGet, urlStr, JSON.String(), nil)
	if err != nil {
		return errors.Wrap(err, "send request")
	}
	var resp BaseResponse
	err = readResponse(httpResp, &resp)
	if err != nil {
		return errors.Wrap(err, "read response")
	}
	return nil
}
func (c *JSONClient) CoreStatus(ctx context.Context, params *CoreParams) (*CoreStatusResponse, error) {
	urlStr := fmt.Sprintf("%s/solr/admin/cores?action=STATUS&"+params.BuildParams(), c.baseURL)
	httpResp, err := c.reqSender.SendRequest(ctx, http.MethodGet, urlStr, JSON.String(), nil)
	if err != nil {
		return nil, errors.Wrap(err, "send request")
	}
	var resp CoreStatusResponse
	err = readResponse(httpResp, &resp)
	if err != nil {
		return nil, errors.Wrap(err, "read response")
	}
	return &resp, nil
}
func (c *JSONClient) CreateCore(ctx context.Context, params *CreateCoreParams) error {
	urlStr := fmt.Sprintf("%s/solr/admin/cores?action=CREATE&"+params.BuildParams(), c.baseURL)
	httpResp, err := c.reqSender.SendRequest(ctx, http.MethodGet, urlStr, JSON.String(), nil)
	if err != nil {
		return errors.Wrap(err, "send request")
	}
	var resp BaseResponse
	err = readResponse(httpResp, &resp)
	if err != nil {
		return errors.Wrap(err, "read response")
	}
	return nil
}
func (c *JSONClient) UnloadCore(ctx context.Context, params *CoreParams) error {
	urlStr := fmt.Sprintf("%s/solr/admin/cores?action=UNLOAD&"+params.BuildParams(), c.baseURL)
	httpResp, err := c.reqSender.SendRequest(ctx, http.MethodGet, urlStr, JSON.String(), nil)
	if err != nil {
		return errors.Wrap(err, "send request")
	}
	var resp BaseResponse
	err = readResponse(httpResp, &resp)
	if err != nil {
		return errors.Wrap(err, "read response")
	}
	return nil
}
func (c *JSONClient) Query(ctx context.Context, collection string, query *Query) (*QueryResponse, error) {
	buf := &bytes.Buffer{}
	err := json.NewEncoder(buf).Encode(query.BuildQuery())
	if err != nil {
		return nil, errors.Wrap(err, "encode request body")
	}
	urlStr := fmt.Sprintf("%s/solr/%s/query", c.baseURL, collection)
	httpResp, err := c.reqSender.SendRequest(ctx, http.MethodPost, urlStr, JSON.String(), buf)
	if err != nil {
		return nil, errors.Wrap(err, "send request")
	}
	var resp QueryResponse
	err = readResponse(httpResp, &resp)
	if err != nil {
		return nil, errors.Wrap(err, "read response")
	}
	return &resp, nil
}
func (c *JSONClient) Update(ctx context.Context, collection string, mimeType MimeType, body io.Reader) (*UpdateResponse, error) {
	urlStr := fmt.Sprintf("%s/solr/%s/update", c.baseURL, collection)
	httpResp, err := c.reqSender.SendRequest(ctx, http.MethodPost, urlStr, mimeType.String(), body)
	if err != nil {
		return nil, errors.Wrap(err, "send request")
	}
	var resp UpdateResponse
	err = readResponse(httpResp, &resp)
	if err != nil {
		return nil, errors.Wrap(err, "read response")
	}
	return &resp, nil
}
func (c *JSONClient) Commit(ctx context.Context, collection string) error {
	urlStr := fmt.Sprintf("%s/solr/%s/update?commit=true", c.baseURL, collection)
	httpResp, err := c.reqSender.SendRequest(ctx, http.MethodGet, urlStr, JSON.String(), nil)
	if err != nil {
		return errors.Wrap(err, "send request")
	}
	var resp UpdateResponse
	err = readResponse(httpResp, &resp)
	if err != nil {
		return errors.Wrap(err, "read response")
	}
	return nil
}
func (c *JSONClient) AddFields(ctx context.Context, collection string, fields ...Field) error {
	return c.modifySchema(ctx, collection, "add-field", fields)
}
func (c *JSONClient) DeleteFields(ctx context.Context, collection string, fields ...Field) error {
	return c.modifySchema(ctx, collection, "delete-field", fields)
}
func (c *JSONClient) ReplaceFields(ctx context.Context, collection string, fields ...Field) error {
	return c.modifySchema(ctx, collection, "replace-field", fields)
}
func (c *JSONClient) AddDynamicFields(ctx context.Context, collection string, fields ...Field) error {
	return c.modifySchema(ctx, collection, "add-dynamic-field", fields)
}
func (c *JSONClient) DeleteDynamicFields(ctx context.Context, collection string, fields ...Field) error {
	return c.modifySchema(ctx, collection, "delete-dynamic-field", fields)
}
func (c *JSONClient) ReplaceDynamicFields(ctx context.Context, collection string, fields ...Field) error {
	return c.modifySchema(ctx, collection, "replace-dynamic-field", fields)
}
func (c *JSONClient) AddFieldTypes(ctx context.Context, collection string, fieldTypes ...FieldType) error {
	return c.modifySchema(ctx, collection, "add-field-type", fieldTypes)
}
func (c *JSONClient) DeleteFieldTypes(ctx context.Context, collection string, fieldTypes ...FieldType) error {
	return c.modifySchema(ctx, collection, "delete-field-type", fieldTypes)
}
func (c *JSONClient) ReplaceFieldTypes(ctx context.Context, collection string, fieldTypes ...FieldType) error {
	return c.modifySchema(ctx, collection, "replace-field-type", fieldTypes)
}