public static function createIndex($shards = null, $replicas = null)
    {
        $instance = new static();

        $client = $instance->getElasticSearchClient();

        $index = [
            'index'     => $instance->getIndexName(),
        ];

        if ($shards) {
            $index['body']['settings']['number_of_shards'] = $shards;
        }

        if ($replicas) {
            $index['body']['settings']['number_of_replicas'] = $replicas;
        }

        return $client->indices()->create($index);
    }