<?php
use Elasticsearch\ClientBuilder;
$client = ClientBuilder::create()->setHosts(['kubernetes.docker.internal:9200'])->build();
$client->indices()->create([
// 索引名
'index' => 'my_index',
'body' => [
'mappings' => [
'properties' => [
// 字段名
'testField' => [
'type' => 'keyword',
]
],
]
]
]);
[Elasticsearch]ElasticSearch7.11通过PHP创建无分析器索引
于 2022-02-22 15:08:01 首次发布