总结几个es的curl操作命令:

查询某条数据:curl -XGET http://elasticsearch:9200/company/company/123?pretty

查询索引下数据总量:curl -XGET http://elasticsearch:9200/company/company/_count?pretty

根据条件查询:curl -XGET http://elasticsearch:9200/company/company/_search?pretty -d '{"query": {"bool":{"must":[{"term":{"aId":"10"}},{"term":{"uId":"333"}}]}}}'

复制一个索引:curl -XPOST 'http://elasticsearch:9200/_reindex' -d '{"source": {"index": "company"},"dest": {"index": "company_bak","op_type": "create"}}'

查看所有索引状态:curl -XGET 'http://elasticsearch:9200/_cat/indices?v'

清空某个索引数据:curl -XPOST 'http://elasticsearch:9200/company/company/_delete_by_query?refresh&slices=5&pretty' -H 'Content-Type: application/json' -d '{"query": {"match_all": {}}}'

在某个索引下添加mapping:curl -XGET http://elasticsearch:9200/_mapping/company' -d '{"properties": {"address": {"type": "text","fields": {"keyword": {"type": "keyword","ignore_above": 256}}}}}'

elasticsearch操作命令的更多相关文章

  1. ElasticSearch服务器操作命令

    在win7环境,进入elasticsearch安装目录的bin目录: 1. elasticsearch.bat 就可以启动elasticsearch了.运行这个插件的好处是:elasticsearch ...

  2. ElasticSearch常用操作命令

    查看系统信息: curl 'http://username:password@192.168.0.40:9200/' curl 'http://username:password@127.0.0.1: ...

  3. ElasticSearch日常使用脚本

    1.启动服务要切换到非root账户 (例子:su - elk --command="/usr/local/elk/kibana/bin/kibana serve &")2. ...

  4. Elasticsearch入门实践

    官网:https://www.elastic.co/ 下载:https://www.elastic.co/downloads/elasticsearch 文档:https://www.elastic. ...

  5. Elasticsearch入门,这一篇就够了

    实时搜索引擎Elasticsearch Elasticsearch(简称ES)是一个基于Apache Lucene(TM)的开源搜索引擎,无论在开源还是专有领域,Lucene可以被认为是迄今为止最先进 ...

  6. elasticsearch 6.3 安装手记

    系统环境 centos 7 elasticsearch 6.3 需要 JDK 8 版本,先安装 JDK 8. ES6.3 安装地址: https://www.elastic.co/guide/en/e ...

  7. elasticsearch 初步

    本文主要内容: 1.elasticsearch的认识(是个啥,能干啥) 2.安装启动.简单集群及关键配置 3.名词解释 4.存取数据,中文分词 ---------------------------- ...

  8. ElasticSearch搜索服务技术

    ElasticSearch 基于的lucene开发的搜索服务技术;天生支持分布式; Es的结构 gatway:存储层,所有的数据可以存储在本地(多个es节点形成分布式存储),hdfs输出位置,共享文件 ...

  9. 【Elasticsearch】集群管理

    8.1 Elasticsearch时光机 Elasticsearch的快照,防止出错,灾备8.1.1 创建快照存储库创建快照之前必须建一个存储库,有如下几个方面,name,type,settings, ...

随机推荐

  1. 【Java】 生成32位随机字符编号

    /** * 生成32位编码 * @return string */ public static String getUUID(){ String uuid = UUID.randomUUID().to ...

  2. mysql 分页offset过大性能问题解决思路

    在公司干活一般使用sqlserver数据库.rownumber分页贼好用. 但是晚上下班搞自己的事情就不用sqlserver了.原因就是自己的渣渣1核2g的小服务器完全扛不住sqlserver那么大的 ...

  3. Linux配置python

    文章出处  https://www.cnblogs.com/yhongji/p/9383857.html 我这里使用的时centos7-mini,centos系统本身默认安装有python2.x,版本 ...

  4. wx.navigateTo、wx.redirectTo、wx.reLaunch、wx.switchTab和wx.navigateBack的区别

    wx.navigateTo.wx.redirectTo.wx.reLaunch.wx.switchTab和wx.navigateBack有什么区别呢? **wx.navigateTo:** 用于保留当 ...

  5. Java并发编程总结(一)Syncronized解析

    Syncronized解析 作用: )确保线程互斥的访问同步代码 )保证共享变量的修改能够及时可见 )有效解决重排序问题. 用法: )修饰普通方法(锁是当前实例对象) )修饰静态方法(锁是当前对象的C ...

  6. 让你如“老”绅士般编写 Python 命令行工具的开源项目:docopt

    作者:HelloGitHub-Prodesire HelloGitHub 的<讲解开源项目>系列,项目地址:https://github.com/HelloGitHub-Team/Arti ...

  7. [BZOJ3813] 奇数国 - 线段树

    3813: 奇数国 Time Limit: 10 Sec  Memory Limit: 256 MBSubmit: 912  Solved: 508[Submit][Status][Discuss] ...

  8. Ubuntu 安装mysql & 自定义数据存储目录

    一.安装 apt-get install mysql-server 执行过程如下: root@duke:~# apt-get install mysql-server 正在读取软件包列表... 完成 ...

  9. 使用docker-compose部署nginx+gunicorn+mariadb的django应用

    目录 1. docker-compose 项目的组织目录 2. 构建 mysql 容器 3. 构建 django-blog 容器 4. 构建 nginx 容器 5. docker-compose.ya ...

  10. Python 命令行之旅:使用 docopt 实现 git 命令

    作者:HelloGitHub-Prodesire HelloGitHub 的<讲解开源项目>系列,项目地址:https://github.com/HelloGitHub-Team/Arti ...