public static function IndexFactory::index in Elasticsearch Connector 8.6
Same name and namespace in other branches
- 8.7 src/ElasticSearch/Parameters/Factory/IndexFactory.php \Drupal\elasticsearch_connector\ElasticSearch\Parameters\Factory\IndexFactory::index()
- 8.2 src/ElasticSearch/Parameters/Factory/IndexFactory.php \Drupal\elasticsearch_connector\ElasticSearch\Parameters\Factory\IndexFactory::index()
- 8.5 src/ElasticSearch/Parameters/Factory/IndexFactory.php \Drupal\elasticsearch_connector\ElasticSearch\Parameters\Factory\IndexFactory::index()
Build parameters required to index.
TODO: We need to handle the following params as well: ['consistency'] = (enum) Explicit write consistency setting for the operation ['refresh'] = (boolean) Refresh the index after performing the operation ['replication'] = (enum) Explicitly set the replication type ['fields'] = (list) Default comma-separated list of fields to return in the response for updates.
Parameters
\Drupal\search_api\IndexInterface $index: Index to create.
bool $with_type: Should the index be created with a type.
Return value
array Associative array with the following keys:
- index: The name of the index on the Elasticsearch server.
- type(optional): The name of the type to use for the given index.
3 calls to IndexFactory::index()
- IndexFactory::bulkDelete in src/
ElasticSearch/ Parameters/ Factory/ IndexFactory.php - Build parameters to bulk delete indexes.
- IndexFactory::bulkIndex in src/
ElasticSearch/ Parameters/ Factory/ IndexFactory.php - Build parameters to bulk delete indexes.
- IndexFactory::mapping in src/
ElasticSearch/ Parameters/ Factory/ IndexFactory.php - Build parameters required to create an index mapping.
File
- src/
ElasticSearch/ Parameters/ Factory/ IndexFactory.php, line 39
Class
- IndexFactory
- Create Elasticsearch Indices.
Namespace
Drupal\elasticsearch_connector\ElasticSearch\Parameters\FactoryCode
public static function index(IndexInterface $index, $with_type = FALSE) {
$params = [];
$params['index'] = static::getIndexName($index);
if ($with_type) {
$params['type'] = $index
->id();
}
return $params;
}