日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

06.search_shard_api操作

發(fā)布時間:2024/2/28 编程问答 20 豆豆
生活随笔 收集整理的這篇文章主要介紹了 06.search_shard_api操作 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

文章目錄

    • 1. Search Shards API 簡介

1. Search Shards API 簡介

search shard api返回行搜索執(zhí)行請求的索引和分片。這可以為問題調(diào)試或通routing and shard preferences調(diào)優(yōu)提供更多的有幫助的信息。

當(dāng)使用過濾別名時,過濾器將作為在5.1.0中添加的索引部分[5.1.0]的一部分返回。

The search shards api returns the indices and shards that a search request would be executed against. This can give useful feedback for working out issues or planning optimizations with routing and shard preferences. When filtered aliases are used, the filter is returned as part of the indices section [5.1.0] Added in 5.1.0.

The index may be a single value, or comma-separated.

Usage
Full example:

GET /twitter/_search_shards

This will yield the following result:

{"nodes": ...,"indices" : {"twitter": { }},"shards": [[{"index": "twitter","node": "JklnKbD7Tyqi9TP3_Q_tBg","primary": true,"shard": 0,"state": "STARTED","allocation_id": {"id":"0TvkCyF7TAmM1wHP4a42-A"},"relocating_node": null}],[{"index": "twitter","node": "JklnKbD7Tyqi9TP3_Q_tBg","primary": true,"shard": 1,"state": "STARTED","allocation_id": {"id":"fMju3hd1QHWmWrIgFnI4Ww"},"relocating_node": null}],[{"index": "twitter","node": "JklnKbD7Tyqi9TP3_Q_tBg","primary": true,"shard": 2,"state": "STARTED","allocation_id": {"id":"Nwl0wbMBTHCWjEEbGYGapg"},"relocating_node": null}],[{"index": "twitter","node": "JklnKbD7Tyqi9TP3_Q_tBg","primary": true,"shard": 3,"state": "STARTED","allocation_id": {"id":"bU_KLGJISbW0RejwnwDPKw"},"relocating_node": null}],[{"index": "twitter","node": "JklnKbD7Tyqi9TP3_Q_tBg","primary": true,"shard": 4,"state": "STARTED","allocation_id": {"id":"DMs7_giNSwmdqVukF7UydA"},"relocating_node": null}]] }

And specifying the same request, this time with a routing value:

GET /twitter/_search_shards?routing=foo,bar

This will yield the following result:

{"nodes": ...,"indices" : {"twitter": { }},"shards": [[{"index": "twitter","node": "JklnKbD7Tyqi9TP3_Q_tBg","primary": true,"shard": 2,"state": "STARTED","allocation_id": {"id":"fMju3hd1QHWmWrIgFnI4Ww"},"relocating_node": null}],[{"index": "twitter","node": "JklnKbD7Tyqi9TP3_Q_tBg","primary": true,"shard": 3,"state": "STARTED","allocation_id": {"id":"0TvkCyF7TAmM1wHP4a42-A"},"relocating_node": null}]] }

This time the search will only be executed against two of the shards, because routing values have been specified.

All parameters:
routing

A comma-separated list of routing values to take into account when determining which shards a request would be executed against.

preference

Controls a preference of which shard replicas to execute the search request on. By default, the operation is randomized between the shard replicas. See the preference documentation for a list of all acceptable values.

local

A boolean value whether to read the cluster state locally in order to determine where shards are allocated instead of using the Master node’s cluster state.

超強(qiáng)干貨來襲 云風(fēng)專訪:近40年碼齡,通宵達(dá)旦的技術(shù)人生

總結(jié)

以上是生活随笔為你收集整理的06.search_shard_api操作的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。