templates and indexes are set and generated. But when I check mapping, I find that enable has always been false:
. $client = new Client();
//
$url = config("scout.elasticsearch.hosts")[0] . "/_template/tmp";
$client->put($url, [
"json" => [
"template" => config("scout.elasticsearch.index"),
"settings" => [
"number_of_shards" => 1
],
"mappings" => [
"_default_" => [
"_all" => [
"enabled" => true
],
"dynamic_templates" => [
[
"strings" => [
"match_mapping_type" => "string",
"mapping" => [
"type" => "text",
"analyzer" => "ik_smart",
"ignore_above" => 256,
"fields" => [
"keyword" => [
"type" => "keyword"
]
]
]
]
]
]
]
]
]
]);
$this->info("===============");
$url = config("scout.elasticsearch.hosts")[0] . "/" . config("scout.elasticsearch.index");
$client->put($url, [
"json" => [
"settings" => [
"refresh_interval" => "5s",
"number_of_shards" => 1,
"number_of_replicas" => 0,
],
"mappings" => [
"_default_" => [
"_all" => [
"enabled" => false
]
]
]
]
]);
$this->info("===============");
google and Baiduo. Did not find a way
Environment java11 elasticsearch5.0
are there any ideas or solutions? Dear gods