zoukankan      html  css  js  c++  java
  • Elasticsearch 添加数据

    Elasticsearch 添加数据
    # 添加ES 数据
    curl -X POST 10.44.99.102:9200/situation-event/situation-event -d {}
      

    Elasticsearch 批量添加数据

    首先我们先构造一个 json文件,内容参考如下:

    {"index": {"_index": "situation-event"}
    {"question": "通过源码安装进行到第四步的时候空白", "anwser":"anwser1"}
    {"index": {"_index": "situation-event"}
    {"question": "为什么windows一键安装包apache无法启动?", "anwser":"anwser2"}
    {"index": {"_index": "situation-event"}
    {"question": "windows一键安装包默认的用户名和密码是什么?", "anwser":"anwser3"}
    {"index": {"_index": "situation-event"}}
    {"question": "windows一键安装包无法开机自动启动", "anwser":"anwser4"}
    {"index": {"_index": "situation-event"}}
    {"qustion": "安装的时候提示没有pdo扩展", "anwser":"anwser5"}

      

     在json文件所在文件夹执行以下命令: 

    curl -X POST "10.44.99.102:9200/_bulk?pretty" -H "Content-Type: application/json;charset=UTF-8" --data-binary @test.json

      

    插入数据的时候他会有一段时间去执行,你需要立即让他去执行添加
    # 立即添加
    curl -X GET 10.44.99.102:9200/situation-event/_refresh

      

      

  • 相关阅读:
    linux向下向上查找
    安卓中的线程
    安卓 新浪微博随便看看
    平面图的基本概念及性质
    软件工程知识点总结
    磁盘阵列RAID原理、种类及性能优缺点对比
    面试题之------三次握手与四次挥手过程
    不忘初心
    考研彼岸,花开馨香
    In和Out指令
  • 原文地址:https://www.cnblogs.com/shangwei/p/13503872.html
Copyright © 2011-2022 走看看