You are here

protected function SearchApiElasticsearchIndex::setMapping in Search API Elasticsearch 7.2

Set Elasticsearch mapping.

Parameters

SearchApiIndex $index:

1 call to SearchApiElasticsearchIndex::setMapping()
SearchApiElasticsearchIndex::createElasticsearchMapping in includes/SearchApiElasticsearchIndex.inc
Create Elasticsearch mapping.

File

includes/SearchApiElasticsearchIndex.inc, line 195

Class

SearchApiElasticsearchIndex

Code

protected function setMapping(SearchApiIndex $index) {
  $this->mapping = [
    'id' => [
      'type' => 'string',
      'include_in_all' => FALSE,
    ],
  ];
  foreach ($index
    ->getFields() as $id => $field) {
    $this->mapping[$id] = $this
      ->getFieldMapping($field);
  }
}