You are here

public function SearchApiElasticsearchAbstractService::fieldsUpdated in Search API Elasticsearch 7

Overrides fieldsUpdated().

We only do the grunt work of building the array of properties. This allows submodules who just need an array of properties to simply call this as a parent method to have the array built for them, thus implementing the DRY principle. The submodule is responsible for the return value.

Parameters

SearchApiIndex $index: The Search API index.

Overrides SearchApiAbstractService::fieldsUpdated

1 call to SearchApiElasticsearchAbstractService::fieldsUpdated()
SearchApiElasticsearchElastica::fieldsUpdated in modules/elastica/includes/SearchApiElasticsearchElastica.inc
Overrides fieldsUpdated().
1 method overrides SearchApiElasticsearchAbstractService::fieldsUpdated()
SearchApiElasticsearchElastica::fieldsUpdated in modules/elastica/includes/SearchApiElasticsearchElastica.inc
Overrides fieldsUpdated().

File

includes/SearchApiElasticsearchAbstractService.inc, line 965
Provides a Elasticsearch-based service class for the Search API.

Class

SearchApiElasticsearchAbstractService
Elasticsearch service abstract class.

Code

public function fieldsUpdated(SearchApiIndex $index) {
  $this->fieldsUpdatedProperties = array(
    'id' => array(
      'type' => 'string',
      'include_in_all' => FALSE,
    ),
  );
  foreach ($index
    ->getFields() as $field_id => $field_data) {
    $this->fieldsUpdatedProperties[$field_id] = $this
      ->getFieldMapping($field_data);
  }

  // Allow other modules to alter properties.
  drupal_alter('search_api_elasticsearch_fields_updated', $index, $this->fieldsUpdatedProperties);
}