ElasticSearch之Get index settings API

获取指定索引的参数的值。

获取指定索引的全部参数,命令样例如下:

curl -X GET "https://localhost:9200/testindex_002/_settings?pretty" --cacert $ES_HOME/config/certs/http_ca.crt -u "elastic:ohCxPH=QBE+s5=*lo7F9"

执行结果的样例,如下:

{
"testindex_002" : {
"settings" : {
"index" : {
"routing" : {
"allocation" : {
"include" : {
"_tier_preference" : "data_content"
}
}
},
"number_of_shards" : "3",
"provided_name" : "testindex_002",
"creation_date" : "1701498436722",
"number_of_replicas" : "2",
"uuid" : "k6twq9y9Qtmcs2AHK-USEQ",
"version" : {
"created" : "8500003"
}
}
}
}
}

获取指定索引的指定参数,精确指定参数名,命令样例如下:

curl -X GET "https://localhost:9200/testindex_002/_settings/index.number_of_shards?pretty" --cacert $ES_HOME/config/certs/http_ca.crt -u "elastic:ohCxPH=QBE+s5=*lo7F9"

执行结果的样例,如下:

{
"testindex_002" : {
"settings" : {
"index" : {
"number_of_shards" : "3"
}
}
}
}

获取指定索引的指定参数,模糊匹配参数名,命令样例如下:

curl -X GET "https://localhost:9200/testindex_002/_settings/index.translog.*?flat_settings=true&include_defaults=true&pretty" --cacert $ES_HOME/config/certs/http_ca.crt -u "elastic:ohCxPH=QBE+s5=*lo7F9"

执行结果的样例,如下:

{
"testindex_002" : {
"settings" : { },
"defaults" : {
"index.translog.durability" : "REQUEST",
"index.translog.flush_threshold_age" : "1m",
"index.translog.flush_threshold_size" : "10gb",
"index.translog.generation_threshold_size" : "64mb",
"index.translog.retention.age" : "-1",
"index.translog.retention.size" : "-1",
"index.translog.sync_interval" : "5s"
}
}
}

方法参数
flat_settings
include_defaults
ignore_unavailable
local

相关资料

posted @   jackieathome  阅读(38)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
点击右上角即可分享
微信分享提示