opensearch-docs-cn/_api-reference/index-apis/get-settings.md

65 lines
2.3 KiB
Markdown
Raw Normal View History

---
layout: default
title: Get settings
parent: Index APIs
nav_order: 100
---
# Get settings
Introduced 1.0
{: .label .label-purple }
The get settings API operation returns all the settings in your index.
## Example
```json
GET /sample-index1/_settings
```
## Path and HTTP methods
```
GET /_settings
GET /<target-index>/_settings
GET /<target-index>/_settings/<setting>
```
## URL parameters
All update settings parameters are optional.
Parameter | Data type | Description
:--- | :--- | :---
&lt;target-index&gt; | String | The index to get settings from. Can be a comma-separated list to get settings from multiple indexes, or use `_all` to return settings from all indexes within the cluster.
&lt;setting&gt; | String | Filter to return specific settings.
allow_no_indices | Boolean | Whether to ignore wildcards that dont match any indexes. Default is `true`.
expand_wildcards | String | Expands wildcard expressions to different indexes. Combine multiple values with commas. Available values are `all` (match all indexes), `open` (match open indexes), `closed` (match closed indexes), `hidden` (match hidden indexes), and `none` (do not accept wildcard expressions), which must be used with `open`, `closed`, or both. Default is `open`.
flat_settings | Boolean | Whether to return settings in the flat form, which can improve readability, especially for heavily nested settings. For example, the flat form of “index”: { “creation_date”: “123456789” } is “index.creation_date”: “123456789”.
include_defaults | String | Whether to include default settings, including settings used within OpenSearch's plugins, in the response. Default is false.
ignore_unavailable | Boolean | If true, OpenSearch does not include missing or closed indexes in the response.
local | Boolean | Whether to return information from the local node only instead of the master node. Default is false.
master_timeout | Time | How long to wait for a connection to the master node. Default is `30s`.
## Response
```json
{
"sample-index1": {
"settings": {
"index": {
"creation_date": "1622672553417",
"number_of_shards": "1",
"number_of_replicas": "1",
"uuid": "GMEA0_TkSaamrnJSzNLzwg",
"version": {
"created": "135217827",
"upgraded": "135238227"
},
"provided_name": "sample-index1"
}
}
}
}
```