Skip to content

Commit 0dee3e7

Browse files
committed
Fix alias API examples
1 parent 9098159 commit 0dee3e7

File tree

5 files changed

+43
-22
lines changed

5 files changed

+43
-22
lines changed

specification/_doc_ids/table.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ add-nodes,https://www.elastic.co/docs/deploy-manage/maintenance/add-and-remove-e
55
ai21-api-models,https://docs.ai21.com/docs/jamba-foundation-models,,
66
ai21-rate-limit,https://docs.ai21.com/reference/api-rate-limits,,
77
alias-update,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-alias,https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-add-alias.html,
8+
aliases,https://www.elastic.co/docs/manage-data/data-store/aliases,https://www.elastic.co/guide/en/elasticsearch/reference/8.19/aliases.html,Aliases
89
aliases-update,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-update-aliases,https://www.elastic.co/guide/en/elasticsearch/reference/8.18/indices-aliases.html,
910
alibabacloud-api-keys,https://opensearch.console.aliyun.com/cn-shanghai/rag/api-key,,
1011
analysis-analyzers,https://www.elastic.co/docs/reference/text-analysis/analyzer-reference,,

specification/indices/put_alias/IndicesPutAliasRequest.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import { Duration } from '@_types/Time'
2929
* @availability stack stability=stable
3030
* @availability serverless stability=stable visibility=public
3131
* @doc_id alias-update
32+
* @ext_doc_id aliases
3233
*/
3334
export interface Request extends RequestBase {
3435
urls: [
Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,26 @@
1-
# summary: indices/aliases.asciidoc:10
2-
method_request: POST _aliases
3-
# description: ''
1+
summary: Filter an alias
2+
method_request: POST /my-index-2099.05.06-000001/_alias/my-alias
3+
description: The filter option uses Query DSL to limit the documents an alias can access.
44
# type: request
5-
value: "{
6-
7-
\ \"actions\": [
8-
9-
\ {
10-
11-
\ \"add\": {
12-
13-
\ \"index\": \"my-data-stream\",
14-
15-
\ \"alias\": \"my-alias\"
16-
17-
\ }
18-
19-
\ }
20-
21-
\ ]
22-
23-
}"
5+
value: |-
6+
{
7+
"filter": {
8+
"bool": {
9+
"filter": [
10+
{
11+
"range": {
12+
"@timestamp": {
13+
"gte": "now-1d/d",
14+
"lt": "now/d"
15+
}
16+
}
17+
},
18+
{
19+
"term": {
20+
"user.id": "kimchy"
21+
}
22+
}
23+
]
24+
}
25+
}
26+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
summary: Write index
2+
method_request: POST /logs-my_app-default/_alias/logs
3+
description: You can use is_write_index to specify a write index or data stream for an alias. Elasticsearch routes any write requests for the alias to this index or data stream.
4+
# type: request
5+
value: |-
6+
{
7+
"is_write_index": true
8+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
summary: Routing
2+
method_request: POST /my-index-2099.05.06-000001/_alias/my-alias
3+
description: Use the routing option to route requests for an alias to a specific shard.
4+
# type: request
5+
value: |-
6+
{
7+
"routing": "1"
8+
}

0 commit comments

Comments
 (0)