You are here

protected function SearchApiElasticsearchIndex::createElasticsearchMapping in Search API Elasticsearch 7.2

Create Elasticsearch mapping.

Parameters

Type $type:

Return value

Mapping

1 call to SearchApiElasticsearchIndex::createElasticsearchMapping()
SearchApiElasticsearchIndex::updateFields in includes/SearchApiElasticsearchIndex.inc
Update fields on an Elasticsearch Index.

File

includes/SearchApiElasticsearchIndex.inc, line 181

Class

SearchApiElasticsearchIndex

Code

protected function createElasticsearchMapping(Type $type) {
  $this
    ->setMapping($this->search_api_index);
  $mapping = new Mapping();
  $mapping
    ->setType($type);
  $mapping
    ->setParam('_all', [
    'enabled' => FALSE,
  ]);
  $mapping
    ->setProperties($this->mapping);
  return $mapping;
}