随笔分类 - elasticsearch
摘要:java操作es有2种方式: 1.通过9300端口 tcp ransport-api.jar 但不能适配版本 不建议使用 2.通过9200端口 http Elasticsearch-Rest-Client 官方restclient 建议使用 导入依赖 //导入依赖 <dependency> <gro
阅读全文
摘要:es 自带分词器_analyze 但是分词器不支持中文 如‘中文’会被默认分割成‘中’‘文’2个词 POST _analyze { "analyzer": "standard", "text": "The 2 Brown-Foxes bone."//定义的分词 空格隔开 } 因此需要安装插件ik分词
阅读全文
摘要:1.批量操作 _bulk POST /customer/external/_bulk {"index":{"_id":3}} {"name":"John Doe3"} {"create":{"_id":4}} {"name":"John Doe3"} //data每2个json绑定数据 第1json
阅读全文
摘要:基本概念:index库>type表>document文档 即index相当于db库 type类似表 document就是表中每行json数据 es保存的数据是json类型 结构示意图如下 1.检索es信息 (1)GET /_cat/nodes:查看所有节点 如:http://192.168.56.1
阅读全文
摘要:1.新建索引并赋值 :put/索引名/文档名/id //文档名后面会逐渐取消 相当表 PUT /test1/type1/1{ "nmae":"hb", "age":"3"} 错误现象:使用 Elasticsearch Head 查看“数据浏览”时,右侧不出数据,使用浏览器F12查看后,发现 406
阅读全文
摘要:kibana是es可视化界面 安装后默认管理地址是: http://localhost:5601索引相当于数据库 index映射相当于表字段名称 mapping文档相当于表字段的值 document表只有一个 定义为_doc 添加索引: put 索引名查询索引:get 索引名删除索引:delete
阅读全文
摘要:1.es tar包传至linux上 并解压 tar -zxvf elasticsearch-7.4.0-linux-x86_64.tar.gz 2.新建用户 useradd xxxname passwd xxxpw 3.在root用户下将解压包的路径授权给新建的用户 chown -R xxxname
阅读全文