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

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                # 多個 GET API 多 GET API 允許基于索引,類型(可選)和ID(也可能路由)獲取多個文檔。響應包括獲取的?`docs`?列表,每個文件的結構都類似于 GET API 提供文件的結構。下面是一個例子: ``` curl 'localhost:9200/_mget' -d '{ "docs" : [ { "_index" : "test", "_type" : "type", "_id" : "1" }, { "_index" : "test", "_type" : "type", "_id" : "2" } ] }' ``` `mget?`也可以針對一個索引(在 body 體中不需要): ``` curl 'localhost:9200/test/_mget' -d '{ "docs" : [ { "_type" : "type", "_id" : "1" }, { "_type" : "type", "_id" : "2" } ] }' ``` 類型如下: ``` curl 'localhost:9200/test/type/_mget' -d '{ "docs" : [ { "_id" : "1" }, { "_id" : "2" } ] }' ``` 在這種情況下,id 可以被用作發起簡單的請求: ``` curl 'localhost:9200/test/type/_mget' -d '{ "ids" : ["1", "2"] }' ``` ## 可選類型 該 MGET API 允許`_type`是可選的。將其設置為?`_all 或`空,以獲取第一個文檔匹配所有類型的ID。 如果不設置類型,許多文件共享相同的?`_id`,你最終將只得到第一個匹配的文件。 例如,如果你有文件1包含 typeA 和 typeB ,那么下面的請求會給你同一個文檔兩次: ``` curl 'localhost:9200/test/_mget' -d '{ "ids" : ["1", "1"] }' ``` 你需要在這種情況下,明確設置`_type`: ``` GET /test/_mget/ { "docs" : [ { "_type":"typeA", "_id" : "1" }, { "_type":"typeB", "_id" : "1" } ] } ``` Source filtering 默認情況下,`_source?`將為每個文檔返回(如果儲存)。類似于 GET ?API,你可以檢索的只是部分?`_source?`使用的?`_source`參數。您還可以使用URL參數?`_source`,`_source_include`及`_source_exclude 來指定`默認值。例如: ``` curl 'localhost:9200/_mget' -d '{ "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"] } } ] }' ``` ## Fields 通過每個文檔來可以指定具體存儲字段,類似于 Get API 中 stored_fields 參數。例如: ``` curl 'localhost:9200/_mget' -d '{ "docs" : [ { "_index" : "test", "_type" : "type", "_id" : "1", "stored_fields" : ["field1", "field2"] }, { "_index" : "test", "_type" : "type", "_id" : "2", "stored_fields" : ["field3", "field4"] } ] }' ``` 或者,可以指定?`stored_fields?`作為默認值被應用到所有文件中來查詢字符串參數。 ``` curl 'localhost:9200/test/type/_mget?stored_fields=field1,field2' -d '{ "docs" : [ { "_id" : "1" (1) }, { "_id" : "2", "stored_fields" : ["field3", "field4"] (2) } ] }' ``` (1)返回?`field1?`和?`field2` (2)返回?`field3?`和?`field4` ## Generated fields 見 “Generated fields” ## Routing 您也可以指定 routing 作為參數: ``` curl 'localhost:9200/_mget?routing=key1' -d '{ "docs" : [ { "_index" : "test", "_type" : "type", "_id" : "1", "_routing" : "key2" }, { "_index" : "test", "_type" : "type", "_id" : "2" } ] }' ``` 在這個例子中,文件?`test/type/2?`將從對應于 routing =?`key1 的分片中獲取。`但文件?`test/type/1`將被從對應于 routing =?`key1 的分片中獲取。` ## 安全 見? 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>

                              哎呀哎呀视频在线观看