Merge pull request #384 from opensearch-project/index-apis

Added open index and put mapping and adjusted front-matter
This commit is contained in:
Keith Chan 2022-01-31 12:01:30 -08:00 committed by GitHub
commit 10739b98dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 132 additions and 9 deletions

View File

@ -2,7 +2,7 @@
layout: default
title: Alias
parent: REST API reference
nav_order: 5
nav_order: 20
---
# Alias
@ -67,7 +67,7 @@ aliases | Array | Array of alias names. | Yes if you don't supply an `alias` fie
filter | Object | A filter to use with the alias, so the alias points to a filtered part of the index. | No
is_hidden | Boolean | Specifies whether the alias should be hidden from results that include wildcard expressions | No
must_exist | Boolean | Specifies whether the alias to remove must exist. | No
is_write_index | Boolean | Specifies whether the index should be a write index. An alias can only have one write index at a time. | No
is_write_index | Boolean | Specifies whether the index should be a write index. An alias can only have one write index at a time. If a write request is submitted to a alias that links to multiple indexes, OpenSearch executes the request only on the write index. | No
routing | String | Used to assign a custom value to a shard for specific operations. | No
index_routing | String | Assigns a custom value to a shard only for index operations. | No
search_routing | String | Assigns a custom value to a shard only for search operations. | No

View File

@ -2,7 +2,7 @@
layout: default
title: Cluster allocation explain
parent: REST API reference
nav_order: 10
nav_order: 50
---
# Cluster allocation explain

View File

@ -2,7 +2,7 @@
layout: default
title: Cluster health
parent: REST API reference
nav_order: 15
nav_order: 55
---
# Cluster health

View File

@ -2,7 +2,7 @@
layout: default
title: Cluster settings
parent: REST API reference
nav_order: 20
nav_order: 60
---
# Cluster settings

View File

@ -3,7 +3,7 @@ layout: default
title: Document APIs
parent: REST API reference
has_children: true
nav_order: 7
nav_order: 40
redirect_from:
- /opensearch/rest-api/document-apis/
---

View File

@ -0,0 +1,48 @@
---
layout: default
title: Open index
parent: Index APIs
grand_parent: REST API reference
nav_order: 40
---
# Open index
Introduced 1.0
{: .label .label-purple }
The open index API operation opens a closed index, letting you add or search for data within the index.
## Example
```json
POST /sample-index/_open
```
## Path and HTTP methods
```
POST /<index-name>/_open
```
## URL parameters
All parameters are optional.
Parameter | Type | Description
:--- | :--- | :---
&lt;index-name&gt; | String | The index to open. Can be a comma-separated list of multiple index names. Use `_all` or * to open all indices.
allow_no_indices | Boolean | Whether to ignore wildcards that don't match any indices. Default is true.
expand_wildcards | String | Expands wildcard expressions to different indices. Combine multiple values with commas. Available values are all (match all indices), open (match open indices), closed (match closed indices), hidden (match hidden indices), and none (do not accept wildcard expressions). Default is open.
ignore_unavailable | Boolean | If true, OpenSearch does not search for missing or closed indices. Default is false.
wait_for_active_shards | String | Specifies the number of active shards that must be available before OpenSearch processes the request. Default is 1 (only the primary shard). Set to all or a positive integer. Values greater than 1 require replicas. For example, if you specify a value of 3, the index must have two replicas distributed across two additional nodes for the request to succeed.
master_timeout | Time | How long to wait for a connection to the master node. Default is `30s`.
timeout | Time | How long to wait for a response from the cluster. Default is `30s`.
## Response
```json
{
"acknowledged": true,
"shards_acknowledged": true
}
```

View File

@ -0,0 +1,75 @@
---
layout: default
title: Put mapping
parent: REST API reference
nav_order: 30
---
# Put mapping
Introduced 1.0
{: .label .label-purple }
The put mapping API operation lets you add new mappings and fields to an index.
## Example
```json
PUT /sample-index/_mapping
{
"properties": {
"age": {
"type": "integer"
},
"occupation":{
"type": "text"
}
}
}
```
## Path and HTTP methods
```
PUT /<target-index>/_mapping
PUT /_mapping
```
## URL parameters
All put mapping parameters are optional.
Parameter | Data Type | Description
:--- | :--- | :---
&lt;target-index&gt; | Data Type | The index to add the mapping to. If you do not specify this parameter, OpenSearch adds the mapping to all indices within the cluster.
allow_no_indices | Boolean | Whether to ignore wildcards that dont match any indices. Default is `true`.
expand_wildcards | String | Expands wildcard expressions to different indices. Combine multiple values with commas. Available values are `all` (match all indices), `open` (match open indices), `closed` (match closed indices), `hidden` (match hidden indices), and `none` (do not accept wildcard expressions), which must be used with `open`, `closed`, or both. Default is `open`.
ignore_unavailable | Boolean | If true, OpenSearch does not include missing or closed indices in the response.
master_timeout | Time | How long to wait for a connection to the master node. Default is `30s`.
timeout | Time | How long to wait for a response from the cluster. Default is `30s`.
write_index_only | Boolean | Whether OpenSearch should add the mapping only to write indexes. If false, OpenSearch can add the mapping to all indexes with the same alias. See [alias]({{site.url}}{{site.baseurl}}/opensearch/rest-api/alias/#request-body) for more information. Default is false.
## Request body
The request body must contain the `properties` object, which has all of the mappings that you want to add.
```json
{
"properties":{
"color":{
"type": "text"
},
"year":{
"type": "integer"
}
}
}
```
## Response
```json
{
"acknowledged": true
}
```

View File

@ -2,7 +2,7 @@
layout: default
title: Remote cluster information
parent: REST API reference
nav_order: 25
nav_order: 70
---
# Remote cluster information

View File

@ -2,7 +2,7 @@
layout: default
title: Search
parent: REST API reference
nav_order: 4
nav_order: 10
---
# Search

View File

@ -2,7 +2,7 @@
layout: default
title: Update mapping
parent: REST API reference
nav_order: 6
nav_order: 35
---
# Update mapping

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 MiB

After

Width:  |  Height:  |  Size: 3.4 MiB