Skip to content

Commit 6373129

Browse files
authored
Merge branch '9.1' into backport/9.1/pr-134506
2 parents 67e46ee + 25c27f9 commit 6373129

File tree

489 files changed

+14498
-12822
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

489 files changed

+14498
-12822
lines changed
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
---
2+
mapped_pages:
3+
- https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-disk-usage.html
4+
applies_to:
5+
serverless: unavailable
6+
stack: all
7+
navigation_title: Analyze index disk usage
8+
---
9+
10+
# Analyze index disk usage API example
11+
12+
The `_disk_usage` API analyzes how much disk space each field in an index or data stream consumes. It helps you understand storage distribution and identify fields that use the most space. This page shows an example request and response for the [Analyze index disk usage API]({{es-apis}}operation/operation-indices-disk-usage).
13+
14+
## Example request
15+
16+
The following request analyzes the disk usage of the index `my-index-000001`:
17+
18+
```console
19+
POST /my-index-000001/_disk_usage?run_expensive_tasks=true
20+
```
21+
% TEST[setup:messages]
22+
23+
## Example response
24+
25+
The API returns:
26+
27+
```console-response
28+
{
29+
"_shards": {
30+
"total": 1,
31+
"successful": 1,
32+
"failed": 0
33+
},
34+
"my-index-000001": {
35+
"store_size": "929mb", <1>
36+
"store_size_in_bytes": 974192723,
37+
"all_fields": {
38+
"total": "928.9mb", <2>
39+
"total_in_bytes": 973977084,
40+
"inverted_index": {
41+
"total": "107.8mb",
42+
"total_in_bytes": 113128526
43+
},
44+
"stored_fields": "623.5mb",
45+
"stored_fields_in_bytes": 653819143,
46+
"doc_values": "125.7mb",
47+
"doc_values_in_bytes": 131885142,
48+
"points": "59.9mb",
49+
"points_in_bytes": 62885773,
50+
"norms": "2.3kb",
51+
"norms_in_bytes": 2356,
52+
"term_vectors": "2.2kb",
53+
"term_vectors_in_bytes": 2310,
54+
"knn_vectors": "0b",
55+
"knn_vectors_in_bytes": 0
56+
},
57+
"fields": {
58+
"_id": {
59+
"total": "49.3mb",
60+
"total_in_bytes": 51709993,
61+
"inverted_index": {
62+
"total": "29.7mb",
63+
"total_in_bytes": 31172745
64+
},
65+
"stored_fields": "19.5mb", <3>
66+
"stored_fields_in_bytes": 20537248,
67+
"doc_values": "0b",
68+
"doc_values_in_bytes": 0,
69+
"points": "0b",
70+
"points_in_bytes": 0,
71+
"norms": "0b",
72+
"norms_in_bytes": 0,
73+
"term_vectors": "0b",
74+
"term_vectors_in_bytes": 0,
75+
"knn_vectors": "0b",
76+
"knn_vectors_in_bytes": 0
77+
},
78+
"_primary_term": {...},
79+
"_seq_no": {...},
80+
"_version": {...},
81+
"_source": {
82+
"total": "603.9mb",
83+
"total_in_bytes": 633281895,
84+
"inverted_index": {...},
85+
"stored_fields": "603.9mb", <4>
86+
"stored_fields_in_bytes": 633281895,
87+
"doc_values": "0b",
88+
"doc_values_in_bytes": 0,
89+
"points": "0b",
90+
"points_in_bytes": 0,
91+
"norms": "0b",
92+
"norms_in_bytes": 0,
93+
"term_vectors": "0b",
94+
"term_vectors_in_bytes": 0,
95+
"knn_vectors": "0b",
96+
"knn_vectors_in_bytes": 0
97+
},
98+
"context": {
99+
"total": "28.6mb",
100+
"total_in_bytes": 30060405,
101+
"inverted_index": {
102+
"total": "22mb",
103+
"total_in_bytes": 23090908
104+
},
105+
"stored_fields": "0b",
106+
"stored_fields_in_bytes": 0,
107+
"doc_values": "0b",
108+
"doc_values_in_bytes": 0,
109+
"points": "0b",
110+
"points_in_bytes": 0,
111+
"norms": "2.3kb",
112+
"norms_in_bytes": 2356,
113+
"term_vectors": "2.2kb",
114+
"term_vectors_in_bytes": 2310,
115+
"knn_vectors": "0b",
116+
"knn_vectors_in_bytes": 0
117+
},
118+
"context.keyword": {...},
119+
"message": {...},
120+
"message.keyword": {...}
121+
}
122+
}
123+
}
124+
```
125+
126+
% TESTRESPONSE[s/: \{\.\.\.\}/: $body.$_path/]
127+
% TESTRESPONSE[s/: (\-)?[0-9]+/: $body.$_path/]
128+
% TESTRESPONSE[s/: "[^"]*"/: $body.$_path/]
129+
130+
1. The total disk space used by the shards analyzed by the API. By default, only primary shards are analyzed.
131+
132+
2. The total disk space used by all fields in the analyzed shards. This total is usually smaller than the `store_size` annotated in <1>, because the API ignores some metadata files.
133+
134+
3. The disk space used by `_id` field values for direct document retrieval. This storage enables [getting a document by its ID]({{es-apis}}operation/operation-get), without needing to search the inverted index.
135+
136+
4. The disk space used by the `_source` field. As stored fields are stored
137+
together in a compressed format, the sizes of stored fields are
138+
estimates and can be inaccurate. The stored size of the `_id` field
139+
is likely underestimated while the `_source` field is overestimated.

docs/reference/elasticsearch/toc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ toc:
8585
- file: rest-apis/filter-search-results.md
8686
- file: rest-apis/find-text-structure-examples.md
8787
- file: rest-apis/highlighting.md
88+
- file: rest-apis/index-disk-usage.md
8889
- file: rest-apis/optimistic-concurrency-control.md
8990
- file: rest-apis/paginate-search-results.md
9091
- file: rest-apis/query-api-keys.md

rest-api-spec/src/main/resources/rest-api-spec/api/_common.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"documentation" : {
2+
"documentation": {
33
"description": "Parameters that are accepted by all API endpoints.",
44
"url": "https://www.elastic.co/guide/en/elasticsearch/reference/current/common-options.html"
55
},

rest-api-spec/src/main/resources/rest-api-spec/api/_internal.delete_desired_balance.json

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,30 @@
11
{
2-
"_internal.delete_desired_balance":{
3-
"documentation":{
2+
"_internal.delete_desired_balance": {
3+
"documentation": {
44
"url": null,
55
"description": "This API is a diagnostics API and the output should not be relied upon for building applications"
66
},
7-
"stability":"experimental",
8-
"visibility":"private",
9-
"headers":{
10-
"accept": [ "application/json"]
7+
"stability": "experimental",
8+
"visibility": "private",
9+
"headers": {
10+
"accept": [
11+
"application/json"
12+
]
1113
},
12-
"url":{
13-
"paths":[
14+
"url": {
15+
"paths": [
1416
{
15-
"path":"/_internal/desired_balance",
16-
"methods":[
17+
"path": "/_internal/desired_balance",
18+
"methods": [
1719
"DELETE"
1820
]
1921
}
2022
]
2123
},
2224
"params": {
23-
"master_timeout":{
24-
"type":"time",
25-
"description":"Timeout for connection to master node"
25+
"master_timeout": {
26+
"type": "time",
27+
"description": "Timeout for connection to master node"
2628
}
2729
}
2830
}

rest-api-spec/src/main/resources/rest-api-spec/api/_internal.delete_desired_nodes.json

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
11
{
2-
"_internal.delete_desired_nodes":{
3-
"documentation":{
2+
"_internal.delete_desired_nodes": {
3+
"documentation": {
44
"url": null,
55
"description": "Designed for indirect use by ECE/ESS and ECK, direct use is not supported."
66
},
7-
"stability":"experimental",
8-
"visibility":"private",
9-
"headers":{
10-
"accept": [ "application/json"]
7+
"stability": "experimental",
8+
"visibility": "private",
9+
"headers": {
10+
"accept": [
11+
"application/json"
12+
]
1113
},
12-
"url":{
13-
"paths":[
14+
"url": {
15+
"paths": [
1416
{
15-
"path":"/_internal/desired_nodes",
16-
"methods":[
17+
"path": "/_internal/desired_nodes",
18+
"methods": [
1719
"DELETE"
1820
]
1921
}
2022
]
2123
},
22-
"params":{
24+
"params": {
2325
"master_timeout": {
2426
"type": "time",
2527
"description": "Timeout for connection to master node"

rest-api-spec/src/main/resources/rest-api-spec/api/_internal.get_desired_balance.json

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,30 @@
11
{
2-
"_internal.get_desired_balance":{
3-
"documentation":{
2+
"_internal.get_desired_balance": {
3+
"documentation": {
44
"url": null,
55
"description": "This API is a diagnostics API and the output should not be relied upon for building applications"
66
},
7-
"stability":"experimental",
8-
"visibility":"private",
9-
"headers":{
10-
"accept": [ "application/json"]
7+
"stability": "experimental",
8+
"visibility": "private",
9+
"headers": {
10+
"accept": [
11+
"application/json"
12+
]
1113
},
12-
"url":{
13-
"paths":[
14+
"url": {
15+
"paths": [
1416
{
15-
"path":"/_internal/desired_balance",
16-
"methods":[
17+
"path": "/_internal/desired_balance",
18+
"methods": [
1719
"GET"
1820
]
1921
}
2022
]
2123
},
2224
"params": {
23-
"master_timeout":{
24-
"type":"time",
25-
"description":"Timeout for connection to master node"
25+
"master_timeout": {
26+
"type": "time",
27+
"description": "Timeout for connection to master node"
2628
}
2729
}
2830
}

rest-api-spec/src/main/resources/rest-api-spec/api/_internal.get_desired_nodes.json

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
{
2-
"_internal.get_desired_nodes":{
3-
"documentation":{
2+
"_internal.get_desired_nodes": {
3+
"documentation": {
44
"url": null,
55
"description": "Gets the latest desired nodes"
66
},
7-
"stability":"experimental",
8-
"visibility":"private",
9-
"headers":{
10-
"accept": [ "application/json"]
7+
"stability": "experimental",
8+
"visibility": "private",
9+
"headers": {
10+
"accept": [
11+
"application/json"
12+
]
1113
},
12-
"url":{
13-
"paths":[
14+
"url": {
15+
"paths": [
1416
{
15-
"path":"/_internal/desired_nodes/_latest",
16-
"methods":[
17+
"path": "/_internal/desired_nodes/_latest",
18+
"methods": [
1719
"GET"
1820
]
1921
}

rest-api-spec/src/main/resources/rest-api-spec/api/_internal.prevalidate_node_removal.json

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,46 @@
11
{
22
"_internal.prevalidate_node_removal": {
3-
"documentation":{
3+
"documentation": {
44
"url": null,
5-
"description":"Prevalidates node removal from the cluster"
5+
"description": "Prevalidates node removal from the cluster"
66
},
7-
"stability":"experimental",
8-
"visibility":"private",
9-
"headers":{
10-
"accept": [ "application/json"]
7+
"stability": "experimental",
8+
"visibility": "private",
9+
"headers": {
10+
"accept": [
11+
"application/json"
12+
]
1113
},
12-
"url":{
13-
"paths":[
14+
"url": {
15+
"paths": [
1416
{
15-
"path":"/_internal/prevalidate_node_removal",
16-
"methods":[
17+
"path": "/_internal/prevalidate_node_removal",
18+
"methods": [
1719
"POST"
1820
]
1921
}
2022
]
2123
},
2224
"params": {
23-
"names":{
24-
"type":"list",
25-
"description":"A comma-separated list of node names to prevalidate"
25+
"names": {
26+
"type": "list",
27+
"description": "A comma-separated list of node names to prevalidate"
2628
},
27-
"ids":{
28-
"type":"list",
29-
"description":"A comma-separated list of node IDs to prevalidate"
29+
"ids": {
30+
"type": "list",
31+
"description": "A comma-separated list of node IDs to prevalidate"
3032
},
31-
"external_ids":{
32-
"type":"list",
33-
"description":"A comma-separated list of node external IDs to prevalidate"
33+
"external_ids": {
34+
"type": "list",
35+
"description": "A comma-separated list of node external IDs to prevalidate"
3436
},
35-
"master_timeout":{
36-
"type":"time",
37-
"description":"Explicit operation timeout for connection to master node"
37+
"master_timeout": {
38+
"type": "time",
39+
"description": "Explicit operation timeout for connection to master node"
3840
},
39-
"timeout":{
40-
"type":"time",
41-
"description":"Explicit operation timeout"
41+
"timeout": {
42+
"type": "time",
43+
"description": "Explicit operation timeout"
4244
}
4345
}
4446
}

0 commit comments

Comments
 (0)