elasticsearch 创建索引

来源:互联网 发布:mui案例源码下载 编辑:程序博客网 时间:2024/05/22 02:23
$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));//批量存入数据
0 0
原创粉丝点击