网站价格,全国工程建设信息服务平台,google永久免费的服务器,零食网页制作素材postman 操作 es 1. 简介2. 环境3. postman操作索引3.1 创建索引3.2 查看索引3.3 查看所有索引3.4 删除索引 4. postman操作文档4.1 添加文档4.2 查询文档4.3 查询全部文档4.4 更新文档4.5 局部更新文档4.6 删除文档4.7 条件查询文档14.8 条件查询文档24.9 条件查询文档 limit4… postman 操作 es 1. 简介2. 环境3. postman操作索引3.1 创建索引3.2 查看索引3.3 查看所有索引3.4 删除索引 4. postman操作文档4.1 添加文档4.2 查询文档4.3 查询全部文档4.4 更新文档4.5 局部更新文档4.6 删除文档4.7 条件查询文档14.8 条件查询文档24.9 条件查询文档 limit4.10 条件查询文档 less 本文是ElasticSearch 的入门文章包含ElasticSearch 的环境准备和基础操作使用postman ElasticSearch 系列文章目的是使用ElasticSearch结合spring boot项目实现项目的搜索功能。 系列文章 spring boot 项目中搭建 ElasticSearch 中间件 二 java api 操作 es spring boot 项目中搭建 ElasticSearch 中间件 三 spring data 操作 es
1. 简介 存储检索数据 集群扩展 PB级处理数据 全文检索分析 日志管理 2. 环境
本文使用 elasticsearch-7.10.0 不同的jdk版本要使用适配的es版本 最新es与jdk适配图
elasticsearch-7.10.0-windows-x86_64\elasticsearch-7.10.0\bin下载后在bin中点击 elasticsearch.bat 启动es 默认端口是9200 es有几个重要概念
索引index 类似数据库中的表一个索引可以理解为一个表文档doc 类似数据库中的行一个文档可以理解为一行数据倒排索引数据库中的id一般是 : id(1001) - name(zhang san), type(man)es进行分词 建立一个zhang - 1001和 “san” - 1001就是倒排索引
3. postman操作索引
3.1 创建索引 注以下操作 以索引名为product为例 注域名前表示请求类型 // 请求类型
post
// 域名
http://localhost:9200/product3.2 查看索引
// 请求类型
get
// 域名
http://localhost:9200/product3.3 查看所有索引
// 请求类型
get
// 域名
http://localhost:9200/_cat/indices?v3.4 删除索引
// 请求类型
delete
// 域名
http://localhost:9200/product4. postman操作文档
4.1 添加文档 注以下操作 以索引名为product为例 注域名前表示请求类型 注以下使用1001作为文档唯一id可以不填es会创建一个唯一id 注_doc为固定写法表示操作文档 // 请求类型
post
// 域名
http://localhost:9200/product/_doc/1001// 请求体body
{title:小米手机,category:小米,image:http://www.sean.com/xm.jpg,price:10000
}4.2 查询文档
// 请求类型
get
// 域名
http://localhost:9200/product/_doc/10014.3 查询全部文档
// 请求类型
get
// 域名
http://localhost:9200/product/_search4.4 更新文档
// 请求类型
put
// 域名
http://localhost:9200/product/_doc/1001// 请求体body
{title:华为手机,category:小米,image:http://www.sean.com/xm.jpg,price:10000
}4.5 局部更新文档
// 请求类型
post
// 域名
http://localhost:9200/product/_update/1001// 请求体body
{doc: {title:mi手机}
}4.6 删除文档
// 请求类型
delete
// 域名
http://localhost:9200/product/_doc/10014.7 条件查询文档1
// 请求类型
get
// 域名
http://localhost:9200/product/_search?qcategory:小米
4.8 条件查询文档2
// 请求类型
get
// 域名
http://localhost:9200/shopping/_search// 请求体body
{query : {match : {category : 小米}}
}4.9 条件查询文档 limit 分页查询 // 请求类型
get
// 域名
http://localhost:9200/shopping/_search// 请求体body
{query : {match : {category : 小米}},from: 0,size: 1
}4.10 条件查询文档 less 只显示一个title字段 // 请求类型
get
// 域名
http://localhost:9200/shopping/_search// 请求体body
{query : {match : {category : 小米}},from: 0,size: 1,_source:[title]
}