# 新增文檔
按上一篇內容,我們創建多個文檔
```
PUT /order_index/order_type/2
{
"orderId":10002,
"userId":10002,
"orderNo":"a10002",
"userName":"Jane",
"totalPrice":80.00,
"address":"江蘇省南京市鼓樓區XXX",
"createTime":"2018-05-16 14:30:00"
}
```
```
PUT /order_index/order_type/3
{
"orderId":10003,
"userId":10003,
"orderNo":"a10003",
"userName":"Douglas",
"totalPrice":100.00,
"address":"江蘇省南京市玄武區XXX",
"createTime":"2018-05-16 14:33:00"
}
```
#### 使用bulk批量寫入數據
bulk api
```
POST _bulk
{ "index" : { "_index" : "test", "_type" : "_doc", "_id" : "1" } }
{ "field1" : "value1" }
{ "delete" : { "_index" : "test", "_type" : "_doc", "_id" : "2" } }
{ "create" : { "_index" : "test", "_type" : "_doc", "_id" : "3" } }
{ "field1" : "value3" }
{ "update" : {"_id" : "1", "_type" : "_doc", "_index" : "test"} }
{ "doc" : {"field2" : "value2"} }
```
批量插入,如:
```
POST _bulk
{"index" : { "_index" : "order_index", "_type" : "order_type", "_id" : "1" } }
{"orderId":10001,"userId":10001,"orderNo":"a10001","userName":"John","totalPrice":50.00,"address":"江蘇省南京市江寧區XXX","createTime":"2018-05-16 14:08:00"}
{"index" : { "_index" : "order_index", "_type" : "order_type", "_id" : "2" } }
{"orderId":10002,"userId":10002,"orderNo":"a10002","userName":"Jane","totalPrice":80.00,"address":"江蘇省南京市鼓樓區XXX","createTime":"2018-05-16 14:30:00"}
{"index" : { "_index" : "order_index", "_type" : "order_type", "_id" : "3" } }
{"orderId":10003,"userId":10003,"orderNo":"a10003","userName":"Douglas","totalPrice":100.00,"address":"江蘇省南京市玄武區XXX","createTime":"2018-05-16 14:33:00"}
```

- 目錄
- 前言
- ElasticSearch基礎
- 基礎概念
- 生產環境配置
- ElasticSearch插件
- ElasticSearch-head插件
- 中文分詞
- ElasticSearch安全插件x-pack
- ElasticSearch查詢
- ElasticSearch語法
- 創建索引
- 新增文檔
- 修改文檔
- 查詢文檔
- 簡單查詢
- 基礎查詢
- 聚合查詢
- 刪除文檔
- ElasticSearch高級查詢
- filter語法
- 關聯查詢
- SpringBoot集成ES的操作
- java操作ES
- Spring-data-elasticsearch操作ES
- SpringBoot性能優化
- ElasticSearch的優化
- ElasticSearch系統優化
- ElasticSearch數據的備份與恢復
- ElasticSearch性能調優
- ElasticSearch集群監控
- ElasticSearch問題匯總
- ElasticSearch問題
- ElasticSearch學習網站