Skip to content

Commit e4f5df1

Browse files
committed
Add examples to index APIs
1 parent 16be4de commit e4f5df1

File tree

73 files changed

+802
-56
lines changed

Some content is hidden

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

73 files changed

+802
-56
lines changed

specification/_doc_ids/table.csv

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@ connector-update-status,https://www.elastic.co/guide/en/elasticsearch/reference/
117117
convert-processor,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/convert-processor.html
118118
cron-expressions,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/api-conventions.html#api-cron-expressions
119119
csv-processor,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/csv-processor.html
120+
dangling-index-delete,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/dangling-index-delete.html
121+
dangling-index-import,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/dangling-index-import.html
122+
dangling-indices-list,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/dangling-indices-list.html
120123
data-processor,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/date-processor.html
121124
data-stream-path-param,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/indices-create-data-stream.html#indices-create-data-stream-api-path-params
122125
data-streams,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/data-streams.html
@@ -224,6 +227,7 @@ index,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/index.htm
224227
indexing-buffer,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/indexing-buffer.html
225228
index-modules-merge,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/index-modules-merge.html
226229
index-templates,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/index-templates.html
230+
index-templates-v1,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/indices-templates-v1.html
227231
indices-aliases,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/indices-aliases.html
228232
indices-analyze,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/indices-analyze.html
229233
indices-clearcache,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/indices-clearcache.html
@@ -232,16 +236,23 @@ indices-close,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/i
232236
indices-component-template,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/indices-component-template.html
233237
indices-create-data-stream,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/indices-create-data-stream.html
234238
indices-create-index,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/indices-create-index.html
239+
indices-delete-alias,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/indices-delete-alias.html
235240
indices-delete-index,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/indices-delete-index.html
241+
indices-delete-template,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/indices-delete-template.html
242+
indices-delete-template-v1,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/indices-delete-template-v1.html
236243
indices-disk-usage,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/indices-disk-usage.html
237244
indices-downsample-data-stream,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/indices-downsample-data-stream.html
238245
indices-exists,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/indices-exists.html
239246
indices-flush,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/indices-flush.html
240247
indices-forcemerge,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/indices-forcemerge.html
248+
indices-get-alias,
249+
https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/indices-get-alias.html
241250
indices-get-field-mapping,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/indices-get-field-mapping.html
242251
indices-get-index,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/indices-get-index.html
243252
indices-get-mapping,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/indices-get-mapping.html
244253
indices-get-settings,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/indices-get-settings.html
254+
indices-get-template,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/indices-get-template.html
255+
indices-get-template-v1,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/indices-get-template-v1.html
245256
indices-open-close,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/indices-open-close.html
246257
indices-put-mapping,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/indices-put-mapping.html
247258
indices-recovery,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/indices-recovery.html
@@ -254,6 +265,7 @@ indices-shards-stores,https://www.elastic.co/guide/en/elasticsearch/reference/{b
254265
indices-shrink-index,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/indices-shrink-index.html
255266
indices-split-index,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/indices-split-index.html
256267
indices-stats,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/indices-stats.html
268+
indices-template-exists-v1,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/indices-template-exists-v1.html
257269
indices-templates,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/indices-templates.html
258270
indices-update-settings,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/indices-update-settings.html
259271
infer-trained-model-deployment,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/infer-trained-model-deployment.html

specification/_global/field_caps/FieldCapabilitiesRequest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import { QueryContainer } from '@_types/query_dsl/abstractions'
3333
* @rest_spec_name field_caps
3434
* @availability stack since=5.4.0 stability=stable
3535
* @availability serverless stability=stable visibility=public
36-
* @index_privileges view_index_metadata,read,manage
36+
* @index_privileges view_index_metadata,read
3737
* @doc_tag search
3838
*/
3939
export interface Request extends RequestBase {

specification/cluster/delete_component_template/ClusterDeleteComponentTemplateRequest.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import { Duration } from '@_types/Time'
2323

2424
/**
2525
* Delete component templates.
26-
* Deletes component templates.
2726
* Component templates are building blocks for constructing index templates that specify index mappings, settings, and aliases.
2827
* @rest_spec_name cluster.delete_component_template
2928
* @availability stack since=7.8.0 stability=stable

specification/cluster/get_component_template/ClusterGetComponentTemplateRequest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import { Duration } from '@_types/Time'
2323

2424
/**
2525
* Get component templates.
26-
* Retrieves information about component templates.
26+
* Get information about component templates.
2727
* @rest_spec_name cluster.get_component_template
2828
* @availability stack since=7.8.0 stability=stable
2929
* @availability serverless stability=stable visibility=public

specification/cluster/put_component_template/ClusterPutComponentTemplateRequest.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import { Duration } from '@_types/Time'
2424

2525
/**
2626
* Create or update a component template.
27-
* Creates or updates a component template.
2827
* Component templates are building blocks for constructing index templates that specify index mappings, settings, and aliases.
2928
*
3029
* An index template can be composed of multiple component templates.
@@ -39,6 +38,11 @@ import { Duration } from '@_types/Time'
3938
*
4039
* You can use C-style `/* *\/` block comments in component templates.
4140
* You can include comments anywhere in the request body except before the opening curly bracket.
41+
*
42+
* **Applying component templates**
43+
*
44+
* You cannot directly apply a component template to a data stream or index.
45+
* To be applied, a component template must be included in an index template's `composed_of` list.
4246
* @rest_spec_name cluster.put_component_template
4347
* @availability stack since=7.8.0 stability=stable
4448
* @availability serverless stability=stable visibility=public
@@ -81,7 +85,7 @@ export interface Request extends RequestBase {
8185
version?: VersionNumber
8286
/**
8387
* Optional user metadata about the component template.
84-
* May have any contents. This map is not automatically generated by Elasticsearch.
88+
* It may have any contents. This map is not automatically generated by Elasticsearch.
8589
* This information is stored in the cluster state, so keeping it short is preferable.
8690
* To unset `_meta`, replace the template without specifying this information.
8791
*/
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
summary: Create a template
2+
# method_request: PUT _component_template/template_1
3+
# description:
4+
# type: request
5+
value:
6+
template:
7+
settings:
8+
number_of_shards: 1
9+
mappings:
10+
_source:
11+
enabled: false
12+
properties:
13+
host_name:
14+
type: keyword
15+
created_at:
16+
type: date
17+
format: 'EEE MMM dd HH:mm:ss Z yyyy'
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
summary: Create a template with aliases
2+
# method_request: PUT _component_template/template_1
3+
description: >
4+
You can include index aliases in a component template.
5+
During index creation, the `{index}` placeholder in the alias name will be replaced with the actual index name that the template gets applied to.
6+
# type: request
7+
value:
8+
template:
9+
settings:
10+
number_of_shards: 1
11+
aliases:
12+
alias1: {}
13+
alias2:
14+
filter:
15+
term:
16+
user.id: kimchy
17+
routing: shard-1
18+
'{index}-alias': {}

specification/dangling_indices/delete_dangling_index/DeleteDanglingIndexRequest.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,13 @@ import { Duration } from '@_types/Time'
2323

2424
/**
2525
* Delete a dangling index.
26-
*
2726
* If Elasticsearch encounters index data that is absent from the current cluster state, those indices are considered to be dangling.
2827
* For example, this can happen if you delete more than `cluster.indices.tombstones.size` indices while an Elasticsearch node is offline.
2928
* @rest_spec_name dangling_indices.delete_dangling_index
3029
* @availability stack since=7.9.0 stability=stable
3130
* @doc_tag indices
31+
* @doc_id dangling-index-delete
32+
* @cluster_privileges manage
3233
*/
3334
export interface Request extends RequestBase {
3435
path_parts: {

specification/dangling_indices/import_dangling_index/ImportDanglingIndexRequest.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ import { Duration } from '@_types/Time'
2929
* @rest_spec_name dangling_indices.import_dangling_index
3030
* @availability stack since=7.9.0 stability=stable
3131
* @doc_tag indices
32+
* @doc_id dangling-index-import
33+
* @cluster_privileges manage
3234
*/
3335
export interface Request extends RequestBase {
3436
path_parts: {
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# summary: ''
2+
description: >
3+
A successful response from `POST /_dangling/zmM4e0JtBkeUjiHD-MihPQ?accept_data_loss=true`.
4+
# type: response
5+
# response_code: 200
6+
value:
7+
acknowledged: true

0 commit comments

Comments
 (0)