<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國際加速解決方案。 廣告
                # Multi Get API Multi GET API允許基于索引、類型(可選)和id(以及可能的路由)獲取多個文檔。響應包括一個具有所有獲取的文檔的`docs`數組,每個元素的結構與[get](Get_API.md) API提供的文檔相似。這是一個例子: ``` GET _mget { "docs" : [ { "_index" : "test", "_type" : "type", "_id" : "1" }, { "_index" : "test", "_type" : "type", "_id" : "2" } ] } ``` `mget`端點也可以用于索引(在這種情況下,它不需要在主體中): ``` GET test/_mget { "docs" : [ { "_type" : "type", "_id" : "1" }, { "_type" : "type", "_id" : "2" } ] } ``` 以及類型: ``` GET test/type/_mget { "docs" : [ { "_id" : "1" }, { "_id" : "2" } ] } ``` 在這種情況下,`ids`元素可以直接用于簡化請求: ``` GET test/type/_mget { "ids" : ["1", "2"] } ``` ## 可選的類型 mget API允許`_type`是可選的。將其設置為`_all`或將其留空,以便獲取與所有類型的`id`匹配的第一個文檔。 如果您沒有設置類型,并且有很多文檔共享相同的`_id`,您將最終只得到第一個匹配的文檔。 例如,如果您在類型A和類型B中有文檔`1`,則以下請求將僅返回相同的文檔兩次: ``` GET test/_mget { "ids" : ["1", "1"] } ``` 在這種情況下需要明確設置`_type`: ``` GET test/_mget/ { "docs" : [ { "_type":"typeA", "_id" : "1" }, { "_type":"typeB", "_id" : "1" } ] } ``` ## Source過濾 默認情況下,將為每個文檔(如果存儲)返回`_source`字段。與[get](Get_API.md) API類似,您只能使用`_source`參數來檢索`_source`(或不是所有)的部分。您還可以使用url參數`_source`、`_source_include`和`_source_exclude`來指定默認值,當沒有每個文檔的指令時,它將被使用。 例如: ``` GET _mget { "docs" : [ { "_index" : "test", "_type" : "type", "_id" : "1", "_source" : false }, { "_index" : "test", "_type" : "type", "_id" : "2", "_source" : ["field3", "field4"] }, { "_index" : "test", "_type" : "type", "_id" : "3", "_source" : { "include": ["user"], "exclude": ["user.location"] } } ] } ``` ## 字段 可以根據Get API的[stored\_fields](Get_API.md#get-stored-fields)參數指定特定的存儲字段,以便每個文檔檢索。例如: ``` GET _mget { "docs" : [ { "_index" : "test", "_type" : "type", "_id" : "1", "stored_fields" : ["field1", "field2"] }, { "_index" : "test", "_type" : "type", "_id" : "2", "stored_fields" : ["field3", "field4"] } ] } ``` 或者,您可以將查詢字符串中的`stored_fields`參數指定為默認值以應用于所有文檔。 ``` GET test/type/_mget?stored_fields=field1,field2 { "docs" : [ { "_id" : "1" //① }, { "_id" : "2", "stored_fields" : ["field3", "field4"] //② } ] } ``` ① 返回`field1`與`field2` - - - - - - ② 返回`field3`與`field4` ## 生成的字段 有關僅在創建索引時生成的字段,請參見[生成的字段章節](Get_API.md#generated-fields)。 ## 路由 你可以通過參數值指定路由值: ``` GET _mget?routing=key1 { "docs" : [ { "_index" : "test", "_type" : "type", "_id" : "1", "_routing" : "key2" }, { "_index" : "test", "_type" : "type", "_id" : "2" } ] } ``` 在這個例子中,文檔`test/type/2`將從對應于路由鍵`key1`的分片中獲取,但是文檔`test/type/1`將從對應于路由鍵`key2`的分片中獲取。 ## 安全 參見[基于URL的訪問控制](../API_Conventions/URL-based_access_control.md)
                  <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>

                              哎呀哎呀视频在线观看