摘要: 把文本转换为一个个的单词,分词称之为analysis。es默认只对英文语句做分词,中文不支持,每个中文字都会被拆分为独立的个体。 英文分词:I a nice boy 中文分词:我是一个好男孩 Elasticsearch 有5种分词 standard:默认分词,单词会被拆分,大小会转换为小写。 sim 阅读全文
posted @ 2020-04-12 18:50 fly_jiang 阅读(919) 评论(0) 推荐(0) 编辑
摘要: 1.插入测试数据 此时 _version 为 1 修改成功 此时 _version 为 2 http://192.168.1.200:9200/my_doc/_doc/10/_update if_seq_no与if_primary_term 模拟并发请求 从结果可以看出 kangxi222被更新成功 阅读全文
posted @ 2020-04-12 17:58 fly_jiang 阅读(1435) 评论(0) 推荐(0) 编辑
摘要: 1. 根据id主键查询 2.查询所有 http://192.168.1.200:9200/my_doc/_doc/_search 3.按照需求查询 查询某个字段 查询单个 查询所有 http://192.168.1.200:9200/my_doc/_doc/_search?_source=id,na 阅读全文
posted @ 2020-04-12 17:32 fly_jiang 阅读(714) 评论(0) 推荐(0) 编辑
摘要: 主键为1的 已经删除 { "_index": "my_doc", "_type": "_doc", "_id": "1", "_version": 2, "result": "deleted", "_shards": { "total": 1, "successful": 1, "failed": 阅读全文
posted @ 2020-04-12 16:06 fly_jiang 阅读(326) 评论(0) 推荐(0) 编辑
摘要: 首先创建测试索引 接下来创建文档 创建完成回到 Elasticsearch head 中查看 其中 ignore_above": 256, 超过 256个字符 使用text 否者使用 keyword 进行检索 点击 数据浏览 查看刚添加的文档信息 如果添加时不指定ID的话 es 会自动生成主键 ht 阅读全文
posted @ 2020-04-12 15:33 fly_jiang 阅读(1535) 评论(0) 推荐(0) 编辑
摘要: (put)请求方式 http://192.168.1.200:9200/index_mapping body 参数 { "mappings":{ "properties":{ "realname":{ "type":"text", "index":true }, "username":{ "type 阅读全文
posted @ 2020-04-12 14:10 fly_jiang 阅读(3320) 评论(0) 推荐(0) 编辑
摘要: 查看集群状态 GET _cluster/health http://192.168.1.200:9200/_cluster/health (GET) { "cluster_name": "cluster es node", 节点名称 "status": "green", //状态 (三个状态 gre 阅读全文
posted @ 2020-04-12 13:38 fly_jiang 阅读(221) 评论(0) 推荐(0) 编辑
摘要: gitHub 地址 https://github.com/mobz/elasticsearch head 克隆到本地 进行npm 安装运行 git clone git://github.com/mobz/elasticsearch head.git 下载完成后进入 cd elasticsearch 阅读全文
posted @ 2020-04-12 10:55 fly_jiang 阅读(539) 评论(0) 推荐(0) 编辑