ElasticSearch7.4批量匯入_bulk
curl -X POST http://localhost:9200/_bulk -H Content-Type:application/json --data-binary @D:\DevEnv\curl-7.68.0-win64-mingw\bin\xx.json
需要匯入的檔案xx.json如下:
{ "index": {"_index": "library", "_type": "book", "_id": "1"}}
{ "title": "All Quiet on the Western Front","otitle": "Im Westen nichts Neues","author": "Erich Maria Remarque","year": 1929,"characters": ["Paul Bäumer", "Albert Kropp", "Haie Westhus", "Fredrich Müller", "Stanislaus Katczinsky", "Tjaden"],"tags": ["novel"],"copies": 1, "available": true, "section" : 3}
{ "index": {"_index": "library", "_type": "book", "_id": "2"}}
{ "title": "Catch-22","author": "Joseph Heller","year": 1961,"characters": ["John Yossarian", "Captain Aardvark", "Chaplain Tappman", "Colonel Cathcart", "Doctor Daneeka"],"tags": ["novel"],"copies": 6, "available" : false, "section" : 1}
{ "index": {"_index": "library", "_type": "book", "_id": "3"}}
{ "title": "The Complete Sherlock Holmes", "author": "Arthur Conan Doyle","year": 1936,"characters": ["Sherlock Holmes","Dr. Watson", "G. Lestrade"],"tags": [],"copies": 0, "available" : false, "section" : 12}
{ "index": {"_index": "library", "_type": "book", "_id": "4"}}
{ "title": "Crime and Punishment","otitle": "Преступлéние и наказáние","author": "Fyodor Dostoevsky","year": 1886,"characters": ["Raskolnikov", "Sofia Semyonovna Marmeladova"],"tags": [],"copies": 0, "available" : true}
注意需要匯入的檔案行與行之間要以換行符相隔,如果匯入時提示出錯,請將檔案內容都歸為一行,然後每一行之間以enterEnter鍵相隔開,然後再匯入。
也可以用postman進行匯入:
相關文章
- SQL Server Bulk Insert批量資料匯入SQLServer
- elasticsearch bulk資料--ES批量匯入json資料ElasticsearchJSON
- mongodb批量操作, bulk_write,MongoDB
- 資訊批量提取工具bulk-extractor
- 圖解JanusGraph系列 - 關於JanusGraph圖資料批量快速匯入的方案和想法(bulk load data)圖解
- sqlldr批量匯入匯出資料測試SQL
- Redis批量匯入文字資料Redis
- 109.全文檢索-ElasticSearch-入門-刪除資料&bulk批量操作匯入樣本測試資料Elasticsearch
- 使用BULK COLLECT+FORALL加速批量提交
- Laravel- 後臺批量匯入 ExcelLaravelExcel
- MySQL 批量匯入資料優化MySql優化
- MATLAB匯入txt和excel檔案技巧彙總:批量匯入、單個匯入MatlabExcel
- 使用bulk collect實現cursor 批量fetch!
- 【SQL】Oracle BLOB 批量匯入匯出圖片語句SQLOracle
- Python批量匯入Excel資料到MySQLPythonExcelMySql
- 使用csv批量匯入、匯出資料的需求處理
- Elasticsearch批量匯入資料指令碼(python)Elasticsearch指令碼Python
- Oracle:從SQL檔案批量匯入資料OracleSQL
- oracle sql*loader批量匯入多個CSVOracleSQL
- AD 批量匯入使用者(利用 for……do……dsadd user 批量建使用者)
- 批量備份還原匯入與匯出MongoDB資料方式昝璽MongoDB
- 【轉載】QP02檢驗計劃批量匯入
- 批量匯入歷史檔案到日誌服務
- 從零開始實現放置遊戲(六):Excel批量匯入遊戲Excel
- SOLIDWORKS高階BOM工具屬性匯入和批量操作Solid
- 程式設計方式實現MySQL批量匯入sql檔案程式設計MySql
- Windows Server2003本地使用者的批量匯入和匯出WindowsServer
- Go 呼叫 elasticsearch 批量操作介面 “/_bulk” ,提示"\n"錯誤GoElasticsearch
- Oracle資料庫的BULK COLLECT用法之批量增刪改<轉>Oracle資料庫
- jsfl批量匯出swfJS
- Dynamics CRM 如何使用XrmToolBox中的Bulk Workflow Execution批量更新資料
- dbms_sql之通用general及bulk批量(大體積)type 型別SQL型別
- 【匯出匯入】匯出匯入 大物件物件
- 【匯入匯出】sqlldr 匯入案例SQL
- .NET Core使用NPOI將Excel中的資料批量匯入到MySQLExcelMySql
- (方法)怎麼快速把電話號碼批量匯入通訊錄
- [mysql] 批量匯入提示: Variable ‘character_set_client’ can’t be set to the value of ‘NULLMySqlclientNull
- 批量匯入某大張表資料的時候的最佳實踐