<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>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                # Delete API(刪除接口) delete API允許基于指定的ID來從索引庫中刪除一個JSON文件。下面演示了從一個叫`twitter`的索引庫的`tweet` type下刪除文檔,`id`是`1`: ``` DELETE /twitter/tweet/1 ``` 上述刪除操作的結果是: ``` { "_shards" : { "total" : 10, "failed" : 0, "successful" : 10 }, "found" : true, "_index" : "twitter", "_type" : "tweet", "_id" : "1", "_version" : 2, "result": "deleted" } ``` ## 版本 索引的每個文檔都被標記了版本。當刪除文檔時, 可以通過指定`version`來確保我們試圖刪除一個實際上已被刪除的文檔時,它在此期間并沒有改變。在文檔中執行的每個寫入操作,包括刪除,都會使其版本遞增。 ## 路由 在創建索引文檔時如果使用了控制路由的能力,為了刪除文檔,也應當提供路由值。例如: ``` DELETE /twitter/tweet/1?routing=kimchy ``` 以上將刪除ID為1的tweet,但會根據用戶路由。請注意,如果刪除路由值不正確,會導致文檔無法刪除。 當映射的`_routing`被設定為`required`且沒有指定的路由值時,刪除API將拋出`RoutingMissingException`并拒絕該請求。 ## 自動創建索引 If an?[external versioning variant](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/docs-index_.html "Index API")?is used, the delete operation automatically creates an index if it has not been created before (check out the?[create index API](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-create-index.html "Create Index")for manually creating an index), and also automatically creates a dynamic type mapping for the specific type if it has not been created before (check out the?[put mapping](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-put-mapping.html "Put Mapping")?API for manually creating type mapping). ## 分布式 刪除操作被散列到一個特定的分片id。然后它被重定向到該ID組內的主分片,和副本分片(如果需要的話)。 ## 等待活動分片 當進行的刪除請求,你可以設置`wait_for_active_shards`參數來要求必須最少達到幾個可用的分片才能開始處理刪除請求。進一步的細節和使用示例見[這里](Index_API.md#index-wait-for-active-shards)。 ## 刷新 用來控制本次的變化能夠被搜索可見。參見:[refresh](refresh.html)。 ## 超時 在執行刪除操作時,分配給執行刪除操作的主分片可能無法使用。有些方面的原因可能是主分片正在從倉庫恢復或進行搬遷。默認情況下,刪除操作在返回失敗與錯誤之前將等待1分鐘讓主分片成為可用的。該`timeout`參數可用于明確指定等待多長時間。這里是將其設置為5分鐘的一個示例: ``` DELETE /twitter/tweet/1?timeout=5m ```
                  <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>

                              哎呀哎呀视频在线观看