ElasticSearch 的使用

可以查看elastic文档官方文档

1.Index 创建test索引库

PUT http://127.0.0.1:9200/test

{
    "settings" : {
        "index" : {
            "number_of_shards" : 3, 
            "number_of_replicas" : 2 
        }
    }
}

2.Mappings 设置test索引库里面的字段

PUT http://127.0.0.1:9200/test/_mapping

{
  "properties": {
    "email": {
      "type": "keyword"
    }
  }
}

3.创建并设置test索引库字段

PUT http://127.0.0.1:9200/test

{
    "settings" : {
        "index" : {
            "number_of_shards" : 3, 
            "number_of_replicas" : 2 
        }
    },
  "properties": {
    "email": {
      "type": "keyword"
    }
  }
}

删除product库

DELETE  http://127.0.0.1:9200/product

清除ElasticSearch所有数据

DELETE  http://127.0.0.1:9200/_all

...未完待续

Last modification:July 12th, 2019 at 04:19 pm
如果觉得我的文章对你有用,请随意赞赏

Leave a Comment