You are here

public static function IndexFactory::index in Elasticsearch Connector 8.7

Same name and namespace in other branches
  1. 8.2 src/ElasticSearch/Parameters/Factory/IndexFactory.php \Drupal\elasticsearch_connector\ElasticSearch\Parameters\Factory\IndexFactory::index()
  2. 8.5 src/ElasticSearch/Parameters/Factory/IndexFactory.php \Drupal\elasticsearch_connector\ElasticSearch\Parameters\Factory\IndexFactory::index()
  3. 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

\Drupal\search_api\IndexInterface $index: Index to create.

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 37

Class

IndexFactory
Create Elasticsearch Indices.

Namespace

Drupal\elasticsearch_connector\ElasticSearch\Parameters\Factory

Code

public static function index(IndexInterface $index) {
  $params = [];
  $params['index'] = static::getIndexName($index);
  return $params;
}