You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: index_create.go
    path of file: ./repos/langchaingo/vectorstores/azureaisearch
    
    the code of the file until where you have to start completion: package azureaisearch

import (
	"bytes"
	"context"
	"encoding/json"
	"fmt"
	"net/http"
)

// IndexOption is used to customise the index when creating the index
// useful if you use differemt embedder than text-embedding-ada-002.
type IndexOption func(indexMap *map[string]interface{}
    
func (s *Store) CreateIndex(ctx context.Context, indexName string, opts ...IndexOption) error {
	defaultIndex := map[string]interface{}{
		"name": indexName,
		"fields": []map[string]interface{}{
			{
				"key":        true,
				"name":       "id",
				"type":       FieldTypeString,
				"filterable": true,
			},
			{
				"name":       "content",
				"type":       FieldTypeString,
				"searchable": true,
			},
			{
				"name":       "contentVector",
				"type":       CollectionField(FieldTypeSingle),
				"searchable": true,
				// dimensions is the number of dimensions generated by the embedding model. For text-embedding-ada-002, it's 1536.
				// basically the length of the array returned by the function
				"dimensions":          vectorDimension,
				"vectorSearchProfile": "default",
			},
			{
				"name":       "metadata",
				"type":       FieldTypeString,
				"searchable": true,
			},
		},
		"vectorSearch": map[string]interface{}{
			"algorithms": []map[string]interface{}{
				{
					"name": "default-hnsw",
					"kind": "hnsw",
					"hnswParameters": map[string]interface{}{
						"m":              hnswParametersM,
						"efConstruction": hnswParametersEfConstruction,
						"efSearch":       hnswParametersEfSearch,
						"metric":         "cosine",
					},
				},
			},
			"profiles": []map[string]interface{}{
				{
					"name":      "default",
					"algorithm": "default-hnsw",
				},
			},
		},
	}

	for _, indexOption := range opts {
		indexOption(&defaultIndex)
	}

	if err := s.CreateIndexAPIRequest(ctx, indexName, defaultIndex); err != nil {
		return fmt.Errorf("error creating index: %w", err)
	}

	return nil
}