<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                # Bulk API Bulk API,能夠在一個單一的API調用執行多項索引/刪除操作。這可以大大提高索引速度。 該 REST API 端點`/_bulk`,它遵循JSON結構: ``` action_and_meta_data\n optional_source\n action_and_meta_data\n optional_source\n .... action_and_meta_data\n optional_source\n ``` 注意:數據的最終行必須以換行符結束`\n`。 可能的操作有?`index`,`create`,`delete?`和?`update`,?`index 和?``create?`期望在下一行的作為源,并與索引 API 有相同的語義。(如果文件具有相同的索引和類型的文件已經存在,就會創建失敗,必要時候而索引回添加或替換文件)。`delete?`不會作為下一行的源,并與 delete API 中具有相同的語義。`update 是希望`部分文檔,upsert 和腳本及其選項能夠在下一行指定。 如果提供的文本文件輸入到?`curl`,必須使用?`--data-binary?`的標志,而不是?`-d`。后者不保留換行符。例: ``` $ cat requests { "index" : { "_index" : "test", "_type" : "type1", "_id" : "1" } } { "field1" : "value1" } $ curl -s -XPOST localhost:9200/_bulk --data-binary "@requests"; echo {"took":7, "errors": false, "items":[{"index":{"_index":"test","_type":"type1","_id":"1","_version":1,"result":"created","forced_refresh":false}}]} ``` 因為這種格式使用?`\n 作為`分隔符,請確保 JSON action 和 source 沒有被打印。這里是一個正確的 bulk 命令使用的例子: ``` { "index" : { "_index" : "test", "_type" : "type1", "_id" : "1" } } { "field1" : "value1" } { "delete" : { "_index" : "test", "_type" : "type1", "_id" : "2" } } { "create" : { "_index" : "test", "_type" : "type1", "_id" : "3" } } { "field1" : "value3" } { "update" : {"_id" : "1", "_type" : "type1", "_index" : "index1"} } { "doc" : {"field2" : "value2"} } ``` 在上面的例子中更新的?`doc?`是不完整的文件,將與已存儲的文件進行合并。 端點是?`/_bulk`,`/{index}/_bulk`和`{index}/{type}/_bulk`。當提供索引或索引/類型時,它們將在 bulk 對象中使用默認值。 對格式的注釋。這里的想法是使該處理盡可能快。由于一些 action 將被重定向到其它分片或在其他節點上,只有?`action_meta_data?`被接收端被解析。 使用此協議應盡量努力做到在客戶端使用,并盡可能減少緩存。 針對 bulk action 的響應是一個大的 Json 結構,包含著每個 action 執行后的結果。單一的 action?故障不會影響其余的操作。 在一個單獨的 bulk call 中沒有正確的執行數目。你應該使用不同的設置實驗來確定適合您的特定工作負載的最佳大小。 如果使用 HTTP API,請確保客戶端不發送 HTTP 塊,因為這會使得運行速度降低。 ## 版本 每個 bulk 對象使用 ?`_version`/?`version 來顯示`使用的版本。它自動基于?`_version?`映射跟隨該索引/刪除操作的行為。它還支持?`version_type`/?`_version_type`(見版本) ## Routing 每個 bulk 對象使用?`_routing`/?`routing 來顯示 routing 值`。它自動基于?`_routing?`映射跟隨該索引/刪除操作的行為。 ## Parent 每個 bulk 對象使用?`_parent`/?`parent`?來顯示 parent 值。它自動基于?`_parent`/`_routing?`映射跟隨該索引/刪除操作的行為。 ## Waiting For Active Shards 當創建 bulk call 時,您可以設置?`wait_for_active_shards`?參數,在開始 bulk 請求之前要求活躍分片副本的最低數量。請參見這里進一步的詳細信息和使用示例。 ## Refresh 控制當通過請求所做的更改是可見的。 ## Update 當使用?`update?`操作,`_retry_on_conflict`可以被用作在 action 本身,指定了在一個版本沖突的情況下多少次更新可以被重試。 更新 action 的負載,支持下列選項:`doc`(部分文檔)`upsert`,`doc_as_upsert`,`script`,`params`(腳本),?`lang`(腳本)和`_source`。見更新文檔的詳細信息。更新 action 的Curl 例子如下: ``` { "update" : {"_id" : "1", "_type" : "type1", "_index" : "index1", "_retry_on_conflict" : 3} } { "doc" : {"field" : "value"} } { "update" : { "_id" : "0", "_type" : "type1", "_index" : "index1", "_retry_on_conflict" : 3} } { "script" : { "inline": "ctx._source.counter += params.param1", "lang" : "painless", "params" : {"param1" : 1}}, "upsert" : {"counter" : 1}} { "update" : {"_id" : "2", "_type" : "type1", "_index" : "index1", "_retry_on_conflict" : 3} } { "doc" : {"field" : "value"}, "doc_as_upsert" : true } { "update" : {"_id" : "3", "_type" : "type1", "_index" : "index1", "_source" : true} } { "doc" : {"field" : "value"} } { "update" : {"_id" : "4", "_type" : "type1", "_index" : "index1"} } { "doc" : {"field" : "value"}, "_source": true} ``` ## 安全 見 URL-based access control
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看