天天看點

es快速建立索引和寫入資料

參考:https://www.cnblogs.com/chenhuabin/p/13850140.html

什麼才是最快建立索引?就是根本不用建立,依賴它的自動生成。

直接POST你想傳入的中繼資料,就可以自動生成索引,根本不用mapping這樣麻煩!

POST /inner_ip/_doc/
{
  "Host":"172.31.10.10",
  "Ports": [{
    "Port": 22,
    "Status": "open",
    "Protocol": "tcp",
    "ServerName": "ssh"
  }, {
    "Port": 80,
    "Status": "open",
    "Protocol": "http",
    "ServerName": "thinkphp"
  }]
}
           

繼續閱讀