ElasticSearch的基本CRUD和postman调用一些常用的api.

windows的安装:https://blog.csdn.net/jiabin30/article/details/82850338

elasticsearch是document的数据格式。

1。ES是面向文档的,文档中存储的数据结构,与面向对象的数据结构是一样的,基于这种文档数据结构,es可以提供复杂的索引,全文检索,分析聚合等功能
2.es的document用json数据格式来表达.


es提供了一套api,叫做cat api,可以查看es中各种各样的数据:

1.查看集群的健康状态:get请求

http://localhost:9200/_cat/health?v

2.快速查看有那些索引;get请求

http://localhost:9200/_cat/indices

3.简单的索引操作:

添加:put请求

http://localhost:9200/shubao/

4.删除索引:DELETE

http://localhost:9200/shubao/

5.创建文档:以post

article:就是文档name

http://localhost:9200/shubaos/article

_id是由系统自动生成的,在添加的时候可以加在请求路径的后面

http://localhost:9200/shubaos/article/1或者2

1.查询文档:get请求

http://localhost:9200/shubaos/article/2

2.替换文档

http://localhost:9200/shubaos/article/2

记得修改下body里面的内容·

替换方式有一个不好,即使必须带上所有的field,才能去进行信息的修改

3.修改问文档内容

http://localhost:9200/shubaos/article/2/_update

body

{
  "doc": {
    "name": "jiaqiangban gaolujie yagao"
  }
}

4.删除文档

DELETE /ecommerce/product/1

猜你喜欢

转载自blog.csdn.net/weixin_41244495/article/details/87773965
今日推荐