es 简单api

创建索引

http://192.168.182.130:9200/s3 PUT

s3 索引名称
PUT api 请求方式

body->json
{
  "settings": {
    "number_of_shards": 5
  },
  "mappings": {
    // "_doc":{
      "properties":{
        "url":{
          "type": "text"
        },
        "key_zh": {
          "type": "text",
          "analyzer": "ik_max_word"
        },
        "key_ug": {
          "type": "text",
          "analyzer": "ik_max_word"
          
        },
        "x_axis":{
          "type": "float"
        },
        "y_axis":{
          "type": "float"
        },
        "have_word":{
          "type": "float"
        }
      }
    }
//   }
}



查看索引信息

http://192.168.182.130:9200/s3 GET

查看所有数据

http://192.168.182.130:9200/s3/_doc/_search GET

查看具体数据

http://192.168.182.130:9200/s3/_doc/1002 GET

1002 是数据id

清空数据

http://192.168.182.130:9200/s2/doc/_delete_by_query?pretty POST

{
    "query": {
        "match_all": {
        }

    }

}

注:其他的看 http://www.ruanyifeng.com/blog/2017/08/elasticsearch.html

上一篇:基于腾讯云搭建属于自己的Fiora聊天室


下一篇:elasticsearch