$url = "127.0.0.1:9200/tyep/";//es存储路径
$json=array();
$json["mappings"]["log"]["properties"]["title"]["type"]="string";
$json["mappings"]["log"]["properties"]["title"]["index"]="not_analyzed";
$json["mappings"]["log"]["properties"]["content"]["type"]="string";
$json["mappings"]["log"]["properties"]["content"]["index"]="not_analyzed";//默认analyzed
$json["mappings"]["log"]["properties"]["subject"]["type"]="string";
$json["mappings"]["log"]["properties"]["subject"]["index"]="not_analyzed";
$json["mappings"]["log"]["properties"]["url"]["type"]="string";
$json["mappings"]["log"]["properties"]["url"]["index"]="not_analyzed";
echo json_encode($json);
$r =$common->callInterfaceCommon($url, "PUT", json_encode($json));//批量存入数据
elasticsearch 创建索引
最新推荐文章于 2022-08-16 11:54:11 发布