public static function IndexFactory::index in Elasticsearch Connector 8.2
Same name and namespace in other branches
- 8.7 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()
- 8.6 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
IndexInterface $index:
bool $with_type:
Return value
array
9 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 TODO: We need also: $params['index'] - (Required) ['type'] - The name of the document type ['timeout'] - (time) Explicit operation timeout
- SearchApiElasticsearchBackend::addIndex in src/
Plugin/ search_api/ backend/ SearchApiElasticsearchBackend.php - Adds a new index to this server.
- SearchApiElasticsearchBackend::doesTypeExists in src/
Plugin/ search_api/ backend/ SearchApiElasticsearchBackend.php - Helper function, check if the type exists.
File
- src/
ElasticSearch/ Parameters/ Factory/ IndexFactory.php, line 29
Class
- IndexFactory
- Class IndexFactory.
Namespace
Drupal\elasticsearch_connector\ElasticSearch\Parameters\FactoryCode
public static function index(IndexInterface $index, $with_type = FALSE) {
$params = [];
$params['index'] = IndexFactory::getIndexName($index);
if ($with_type) {
$params['type'] = $index
->id();
}
return $params;
}