格式:<REST Verb>/<Index>/<Type>/<ID>

集群健康:
curl -u lases:1fw@2soc#3vpn -XGET 'localhost:9200/_cat/health?v&pretty'

节点:
curl -u lases:1fw@2soc#3vpn -XGET 'localhost:9200/_cat/nodes?v&pretty'
查看索引:
curl -u lases:1fw@2soc#3vpn -XGET 'localhost:9200/_cat/indices?v&pretty'
创建:
curl -u lases:1fw@2soc#3vpn -XPUT 'localhost:9200/customer?pretty&pretty'
搜索:
curl -u lases:1fw@2soc#3vpn -XGET 'localhost:9200/index/report/1?pretty&pretty'
删除:
curl -u lases:1fw@2soc#3vpn -XDELETE 'localhost:9200/customer?pretty&pretty'

节点磁盘使用:
curl -u lases:1fw@2soc#3vpn -XGET 'localhost:9200/_cat/allocation?v'
插件:
curl -u lases:1fw@2soc#3vpn -XGET 'localhost:9200/_cat/plugins?v&s=component&h=name,component,version,description'

bulk api:
插入:curl -XPOST 'localhost:9200/customer/external/_bulk?pretty&pretty' -d'
{"index":{"_id":"1"}}
{"name": "John Doe" }
{"index":{"_id":"2"}}
{"name": "Jane Doe" }
更新+删除:curl -XPOST 'localhost:9200/customer/external/_bulk?pretty&pretty' -d'
{"update":{"_id":"1"}}
{"doc": { "name": "John Doe becomes Jane Doe" } }
{"delete":{"_id":"2"}}

导入:
curl -XPOST 'localhost:9200/bank/account/_bulk?pretty&refresh' --data-binary "@accounts.json"

搜索:
curl -XGET 'localhost:9200/bank/_search?pretty' -d'
{
"query": { "match_all": {} },
"sort": [
{ "account_number": "asc" }
],
"from": 10,
"size": 1
"_source": ["account_number", "balance"]
}'

bool查询:
{
"query": {
"bool": {
"must": [ //should,must_not
{ "match": { "address": "mill" } },
{ "match": { "address": "lane" } }
],
"filter": {
"range": {
"balance": {
"gte": 20000,
"lte": 30000
}
}
}
}
}
}

聚合:
{
"size": 0,
"aggs": {
"group_by_state": {
"terms": {
"field": "state.keyword"
}
}
}
}

跨集群搜索:
curl -X POST "localhost:9200/cluster_one:skyeye-las_event-2018.09.11/sim/_search?pretty" -H 'Content-Type: application/json' -d'
{
"query": {
"match_all": {}
}
}

跨集群参数配置:

curl -k -u lases:1fw@2soc#3vpn -XPUT "https://localhost:9200/_cluster/settings" -H 'Content-Type: application/json' -d'
{
"persistent": {
"search": {
"remote": {
"cluster_one": {
"seeds": [
"10.95.36.30:9300"
]
}
}
}
}
}'

插件安装:

sh elasticsearch-plugin install -b file:///home/es/search-guard-5-5.6.10-19.2.zip

sgadmin.sh -cn es -h 127.0.0.1 -cd /home/es/root/plugins/search-guard-5/sgconfig -ks /home/es/root/plugins/search-guard-5/sgconfig/es-keystore.jks -kspass 1fw@2soc#3vpn -ts /home/es/root/plugins/search-guard-5/sgconfig/truststore.jks -tspass 1fw@2soc#3vpn -nhnv

sh sgadmin.sh -cn es -h 127.0.0.1 --accept-red-cluster -cd /home/es/root/plugins/search-guard-5/sgconfig -ks /home/es/root/plugins/search-guard-5/sgconfig/es-keystore.jks -kspass 1fw@2soc#3vpn -ts /home/es/root/plugins/search-guard-5/sgconfig/truststore.jks -tspass 1fw@2soc#3vpn -nhnv

ES常用操作备忘的更多相关文章

  1. Axure常用操作备忘

    目录 前言 技巧 边框重合 复制对象文本居中 复制粘贴样式 文本自适应 给图形添加连接点 导出图片无空白 前言 下面列出Axure画图过程中曾经遇到过的问题,备忘一下,避免别人也走弯路,法布施一下~ ...

  2. docker常用操作备忘

    一.docker安装 参考资料:阿里云镜像加速1. 安装/升级Docker客户端 curl -fsSL https://get.docker.com | bash -s docker --mirror ...

  3. Kafka常用操作备忘

    启动nohup ./bin/zookeeper-server-start.sh config/zookeeper.properties &nohup ./bin/kafka-server-st ...

  4. metasploit 常用命令备忘

    metasploit 常用命令备忘    MSFconsole Commands-------------------------------------24show exploits 查看所有exp ...

  5. Linux基础之常用基本命令备忘

    Linux基础之常用基本命令备忘 PWD   查询当前所在Linux上的位置 /         根目录 CD(change directory)切换目录  语法 CD /(注意添加空格)   LS ...

  6. Webstorm常用快捷键备忘(Webstorm入门指南)

    WebStorm 是jetbrains公司旗下一款JavaScript 开发工具.被广大中国JS开发者誉为“Web前端开发神器”.“最强大的HTML5编辑器”.“最智能的JavaSscript IDE ...

  7. sublime 常用快捷键备忘

    转一篇sublime常用的快捷键备忘 sublime常用快捷键 选择类Ctrl+D 选中光标所占的文本,继续操作则会选中下一个相同的文本.Alt+F3 选中文本按下快捷键,即可一次性选择全部的相同文本 ...

  8. Webstorm常用快捷键备忘

    WebStorm 是jetbrains公司旗下一款JavaScript 开发工具.被广大中国JS开发者誉为“Web前端开发神器”.“最强大的HTML5编辑器”.“最智能的JavaSscript IDE ...

  9. CentOS常用命令备忘

    1. 查看进程 ps -a 杀掉进程 kill PID 2. 添加计划任务crontab -e 例如:30 21 * * * service httpd restart 每天21:30重启apache ...

随机推荐

  1. 使用servlet+jdbc+MD5实现用户加密登录

    /** * 分析流程: * 1.前端页面提交登录请求 * 2.被web.xml拦截,进入到LoginServlet(有两种方式:方式一,在web.xml文件中配置servlet拦截器;方式二,不用在w ...

  2. Julia初学备忘

    println("hello!") println("hello!") print("hello!") print("hello! ...

  3. invalid comparison: java.util.ArrayList and java.lang.String解决

    报错: Caused by: org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause ...

  4. 玩转 SpringBoot 2 快速整合拦截器

    概述 首先声明一下,这里所说的拦截器是 SpringMVC 的拦截器 HandlerInterceptor.使用SpringMVC 拦截器需要做如下操作: 创建拦截器类需要实现 HandlerInte ...

  5. jQuery鼠标滑过横向时间轴效果

    jQuery鼠标滑过横向时间轴效果---效果图: jQuery鼠标滑过横向时间轴效果---全部代码: <!DOCTYPE html> <html> <head> & ...

  6. asp.net core 自定义中间件【以dapper为例】

    在asp.net core开发中.按照国际案例开始.都是先在Nuget安装XXX包.比如我们今天要用到的Dapper nuget里面安装Dapper 1.然后新建一个类文件DapperExtensio ...

  7. 计算机视觉(二)-opencv之createTrackbar()详解

    摘要: 我学习openCV3看的是<学习openCV3>这本书,很厚的一本,不知道是不是因为自己看的还不是很多,个人觉得里面的有些重要函数讲的不是很详细,比如createTrackbar( ...

  8. 配置中心-Apollo

    配置中心-Apollo 2019/10/01 Chenxin 配置服务主要有 携程Apollo.百度Disconf.阿里ACM,目前以Apollo用户量最大.适用场景,多用于微服务,与K8S结合好. ...

  9. 服务器时间误差导致的google sign-in后台验证错误(远程调试java程序)

    https://developers.google.com/identity/sign-in/web/backend-auth import com.google.api.client.googlea ...

  10. 一文掌握在Word中快速编写公式

    在使用Word编写文章时,总会遇到书写数学公式的情况.使用Word的公式输入工具需要频繁地使用鼠标,因而编写公式会显得繁琐麻烦,那么有什么办法可以优雅地在Word中书写公式呢?其实Word早在Word ...