mapping example

$this->client->indices()->refresh([
            'index' => $index,
        ]);
        $this->client->indices()->putAlias(['index' => $index, 'name' => $alias]);
    }

    /** * @return array<mixed> */
    private function buildMapping(AbstractAdminIndexer $indexer): array
    {
        $mapping = $indexer->mapping([
            'properties' => [
                'id' => ['type' => 'keyword'],
                'textBoosted' => ['type' => 'text'],
                'text' => ['type' => 'text'],
                'entityName' => ['type' => 'keyword'],
                'parameters' => ['type' => 'keyword'],
            ],
        ]);

        return array_merge_recursive($mapping$this->mapping);
    }
}
Home | Imprint | This part of the site doesn't use cookies.