public function createIndex($withMapping = true) { $params = array(); $params['index'] = $this->options->getIndexName(); $params['body']['settings']['number_of_shards'] = $this->options->getShards(); $params['body']['settings']['number_of_replicas'] = $this->options->getReplicas(); $params['body']['settings']['analysis'] = $this->getAnalysis(); if ($withMapping) { $params['body']['mappings'][RecordIndexer::TYPE_NAME] = $this->recordIndexer->getMapping(); $params['body']['mappings'][TermIndexer::TYPE_NAME] = $this->termIndexer->getMapping(); } $this->client->indices()->create($params); }