diff --git a/_api-reference/alias.md b/_api-reference/alias.md
index 8c0ff8bcaf6..349f4ac6359 100644
--- a/_api-reference/alias.md
+++ b/_api-reference/alias.md
@@ -29,7 +29,6 @@ POST _aliases
"alias": "old-index-alias"
}
}
-
]
}
```
diff --git a/_api-reference/analyze-apis/perform-text-analysis.md b/_api-reference/analyze-apis/perform-text-analysis.md
index 6ce733bfdaa..25b81a878e4 100644
--- a/_api-reference/analyze-apis/perform-text-analysis.md
+++ b/_api-reference/analyze-apis/perform-text-analysis.md
@@ -85,6 +85,7 @@ GET /_analyze
"text" : ["first array element", "second array element"]
}
````
+{% include copy-curl.html %}
The previous request returns the following fields:
@@ -150,6 +151,7 @@ GET /_analyze
"text" : "OpenSearch text analysis"
}
````
+{% include copy-curl.html %}
The previous request returns the following fields:
@@ -196,6 +198,7 @@ GET /books2/_analyze
"text" : "Le garçon m'a SUIVI."
}
````
+{% include copy-curl.html %}
The previous request returns the following fields:
@@ -248,6 +251,7 @@ GET /_analyze
"text" : "OpenSearch filter"
}
````
+{% include copy-curl.html %}
The previous request returns the following fields:
@@ -277,6 +281,7 @@ GET /_analyze
"text" : "Leave right now!"
}
````
+{% include copy-curl.html %}
The previous request returns the following fields:
@@ -308,6 +313,7 @@ GET /_analyze
"text" : "how to train your dog in five steps"
}
````
+{% include copy-curl.html %}
The previous request returns the following fields:
@@ -372,6 +378,7 @@ GET /books/_analyze
"text" : "OpenSearch analyze test"
}
````
+{% include copy-curl.html %}
The previous request returns the following fields:
@@ -414,6 +421,7 @@ GET /books/_analyze
"text" : "OpenSearch analyze test"
}
````
+{% include copy-curl.html %}
The previous request returns the following fields:
@@ -446,6 +454,7 @@ GET /books2/_analyze
"text" : "OpenSearch analyze test"
}
````
+{% include copy-curl.html %}
The previous request returns the following fields:
@@ -492,6 +501,7 @@ GET /books2/_analyze
"text" : "C'est le garçon qui m'a suivi."
}
````
+{% include copy-curl.html %}
The previous request returns the following fields:
@@ -522,6 +532,7 @@ GET /_analyze
"text" : "That is the boy who followed me."
}
````
+{% include copy-curl.html %}
The previous request returns the following fields:
@@ -555,6 +566,7 @@ GET /_analyze
"attributes" : ["keyword"]
}
````
+{% include copy-curl.html %}
The previous request returns the following fields:
@@ -635,6 +647,8 @@ PUT /books2
}
}
````
+{% include copy-curl.html %}
+
The preceding request is an index API rather than an analyze API. See [DYNAMIC INDEX SETTINGS]({{site.url}}{{site.baseurl}}/api-reference/index-apis/create-index/#dynamic-index-settings) for additional details.
{: .note}
diff --git a/_api-reference/cat/cat-aliases.md b/_api-reference/cat/cat-aliases.md
index fb4f0e2222d..7118465dfb1 100644
--- a/_api-reference/cat/cat-aliases.md
+++ b/_api-reference/cat/cat-aliases.md
@@ -18,18 +18,21 @@ The CAT aliases operation lists the mapping of aliases to indices, plus routing
```json
GET _cat/aliases?v
```
+{% include copy-curl.html %}
To limit the information to a specific alias, add the alias name after your query:
```json
GET _cat/aliases/?v
```
+{% include copy-curl.html %}
If you want to get information for more than one alias, separate the alias names with commas:
```json
GET _cat/aliases/alias1,alias2,alias3
```
+{% include copy-curl.html %}
## Path and HTTP methods
diff --git a/_api-reference/cat/cat-allocation.md b/_api-reference/cat/cat-allocation.md
index 021b99e0586..96a93950538 100644
--- a/_api-reference/cat/cat-allocation.md
+++ b/_api-reference/cat/cat-allocation.md
@@ -18,18 +18,21 @@ The CAT allocation operation lists the allocation of disk space for indices and
```json
GET _cat/allocation?v
```
+{% include copy-curl.html %}
To limit the information to a specific node, add the node name after your query:
```json
GET _cat/allocation/
```
+{% include copy-curl.html %}
If you want to get information for more than one node, separate the node names with commas:
```json
GET _cat/allocation/node_name_1,node_name_2,node_name_3
```
+{% include copy-curl.html %}
## Path and HTTP methods
diff --git a/_api-reference/cat/cat-cluster_manager.md b/_api-reference/cat/cat-cluster_manager.md
index 1538c703507..2508fce675b 100644
--- a/_api-reference/cat/cat-cluster_manager.md
+++ b/_api-reference/cat/cat-cluster_manager.md
@@ -18,6 +18,7 @@ The CAT cluster manager operation lists information that helps identify the elec
```
GET _cat/cluster_manager?v
```
+{% include copy-curl.html %}
## Path and HTTP methods
diff --git a/_api-reference/cat/cat-count.md b/_api-reference/cat/cat-count.md
index ab40540685d..e0c41c078b7 100644
--- a/_api-reference/cat/cat-count.md
+++ b/_api-reference/cat/cat-count.md
@@ -18,18 +18,21 @@ The CAT count operation lists the number of documents in your cluster.
```json
GET _cat/count?v
```
+{% include copy-curl.html %}
To see the number of documents in a specific index or alias, add the index or alias name after your query:
```json
GET _cat/count/?v
```
+{% include copy-curl.html %}
If you want to get information for more than one index or alias, separate the index or alias names with commas:
```json
GET _cat/count/index_or_alias_1,index_or_alias_2,index_or_alias_3
```
+{% include copy-curl.html %}
## Path and HTTP methods
diff --git a/_api-reference/cat/cat-field-data.md b/_api-reference/cat/cat-field-data.md
index a2c4346225d..10c32939c1a 100644
--- a/_api-reference/cat/cat-field-data.md
+++ b/_api-reference/cat/cat-field-data.md
@@ -18,18 +18,21 @@ The CAT fielddata operation lists the memory size used by each field per node.
```json
GET _cat/fielddata?v
```
+{% include copy-curl.html %}
To limit the information to a specific field, add the field name after your query:
```json
GET _cat/fielddata/?v
```
+{% include copy-curl.html %}
If you want to get information for more than one field, separate the field names with commas:
```json
GET _cat/fielddata/field_name_1,field_name_2,field_name_3
```
+{% include copy-curl.html %}
## Path and HTTP methods
diff --git a/_api-reference/cat/cat-health.md b/_api-reference/cat/cat-health.md
index 12613a48a5b..5c5fab0e5b7 100644
--- a/_api-reference/cat/cat-health.md
+++ b/_api-reference/cat/cat-health.md
@@ -18,12 +18,14 @@ The CAT health operation lists the status of the cluster, how long the cluster h
```json
GET _cat/health?v
```
+{% include copy-curl.html %}
## Path and HTTP methods
```
GET _cat/health?v
```
+{% include copy-curl.html %}
## URL parameters
diff --git a/_api-reference/cat/cat-indices.md b/_api-reference/cat/cat-indices.md
index 75bc5f4d312..32c983bf07d 100644
--- a/_api-reference/cat/cat-indices.md
+++ b/_api-reference/cat/cat-indices.md
@@ -18,18 +18,21 @@ The CAT indices operation lists information related to indices—how much dis
```
GET _cat/indices?v
```
+{% include copy-curl.html %}
To limit the information to a specific index, add the index name after your query.
```
GET _cat/indices/?v
```
+{% include copy-curl.html %}
If you want to get information for more than one index, separate the indices with commas:
```json
GET _cat/indices/index1,index2,index3
```
+{% include copy-curl.html %}
## Path and HTTP methods
diff --git a/_api-reference/cat/cat-nodeattrs.md b/_api-reference/cat/cat-nodeattrs.md
index b7cfe0873cf..ebfb58cb42e 100644
--- a/_api-reference/cat/cat-nodeattrs.md
+++ b/_api-reference/cat/cat-nodeattrs.md
@@ -18,6 +18,7 @@ The CAT nodeattrs operation lists the attributes of custom nodes.
```
GET _cat/nodeattrs?v
```
+{% include copy-curl.html %}
## Path and HTTP methods
diff --git a/_api-reference/cat/cat-nodes.md b/_api-reference/cat/cat-nodes.md
index d05e6eda99c..ace8a287e2c 100644
--- a/_api-reference/cat/cat-nodes.md
+++ b/_api-reference/cat/cat-nodes.md
@@ -20,6 +20,7 @@ A few important node metrics are `pid`, `name`, `cluster_manager`, `ip`, `port`,
```
GET _cat/nodes?v
```
+{% include copy-curl.html %}
## Path and HTTP methods
diff --git a/_api-reference/cat/cat-pending-tasks.md b/_api-reference/cat/cat-pending-tasks.md
index 2657fab3916..fa9a5810174 100644
--- a/_api-reference/cat/cat-pending-tasks.md
+++ b/_api-reference/cat/cat-pending-tasks.md
@@ -18,6 +18,7 @@ The CAT pending tasks operation lists the progress of all pending tasks, includi
```
GET _cat/pending_tasks?v
```
+{% include copy-curl.html %}
## Path and HTTP methods
diff --git a/_api-reference/cat/cat-plugins.md b/_api-reference/cat/cat-plugins.md
index f6c29867497..2f53512775e 100644
--- a/_api-reference/cat/cat-plugins.md
+++ b/_api-reference/cat/cat-plugins.md
@@ -18,6 +18,7 @@ The CAT plugins operation lists the names, components, and versions of the insta
```
GET _cat/plugins?v
```
+{% include copy-curl.html %}
## Path and HTTP methods
diff --git a/_api-reference/cat/cat-recovery.md b/_api-reference/cat/cat-recovery.md
index 6dd20885e1f..c1df5e3a6d8 100644
--- a/_api-reference/cat/cat-recovery.md
+++ b/_api-reference/cat/cat-recovery.md
@@ -18,18 +18,21 @@ The CAT recovery operation lists all completed and ongoing index and shard recov
```
GET _cat/recovery?v
```
+{% include copy-curl.html %}
To see only the recoveries of a specific index, add the index name after your query.
```
GET _cat/recovery/?v
```
+{% include copy-curl.html %}
If you want to get information for more than one index, separate the indices with commas:
```json
GET _cat/recovery/index1,index2,index3
```
+{% include copy-curl.html %}
## Path and HTTP methods
diff --git a/_api-reference/cat/cat-repositories.md b/_api-reference/cat/cat-repositories.md
index 34811b04244..997b993cdd8 100644
--- a/_api-reference/cat/cat-repositories.md
+++ b/_api-reference/cat/cat-repositories.md
@@ -18,6 +18,7 @@ The CAT repositories operation lists all completed and ongoing index and shard r
```
GET _cat/repositories?v
```
+{% include copy-curl.html %}
## Path and HTTP methods
diff --git a/_api-reference/cat/cat-segments.md b/_api-reference/cat/cat-segments.md
index 2014e466826..131a7a74a57 100644
--- a/_api-reference/cat/cat-segments.md
+++ b/_api-reference/cat/cat-segments.md
@@ -18,18 +18,21 @@ The cat segments operation lists Lucene segment-level information for each index
```
GET _cat/segments?v
```
+{% include copy-curl.html %}
To see only the information about segments of a specific index, add the index name after your query.
```
GET _cat/segments/?v
```
+{% include copy-curl.html %}
If you want to get information for more than one index, separate the indices with commas:
```
GET _cat/segments/index1,index2,index3
```
+{% include copy-curl.html %}
## Path and HTTP methods
diff --git a/_api-reference/cat/cat-shards.md b/_api-reference/cat/cat-shards.md
index c614a3fd894..d07127c46ea 100644
--- a/_api-reference/cat/cat-shards.md
+++ b/_api-reference/cat/cat-shards.md
@@ -18,18 +18,21 @@ The CAT shards operation lists the state of all primary and replica shards and h
```
GET _cat/shards?v
```
+{% include copy-curl.html %}
To see only the information about shards of a specific index, add the index name after your query.
```
GET _cat/shards/?v
```
+{% include copy-curl.html %}
If you want to get information for more than one index, separate the indices with commas:
```
GET _cat/shards/index1,index2,index3
```
+{% include copy-curl.html %}
## Path and HTTP methods
diff --git a/_api-reference/cat/cat-snapshots.md b/_api-reference/cat/cat-snapshots.md
index 6f59401be72..fcdd3c61ba4 100644
--- a/_api-reference/cat/cat-snapshots.md
+++ b/_api-reference/cat/cat-snapshots.md
@@ -18,6 +18,7 @@ The CAT snapshots operation lists all snapshots for a repository.
```
GET _cat/snapshots?v
```
+{% include copy-curl.html %}
## Path and HTTP methods
diff --git a/_api-reference/cat/cat-tasks.md b/_api-reference/cat/cat-tasks.md
index 4e51973da6e..d80fb11cc04 100644
--- a/_api-reference/cat/cat-tasks.md
+++ b/_api-reference/cat/cat-tasks.md
@@ -18,6 +18,7 @@ The CAT tasks operation lists the progress of all tasks currently running on you
```
GET _cat/tasks?v
```
+{% include copy-curl.html %}
## Path and HTTP methods
diff --git a/_api-reference/cat/cat-templates.md b/_api-reference/cat/cat-templates.md
index acdb9a114d8..f361ae26f48 100644
--- a/_api-reference/cat/cat-templates.md
+++ b/_api-reference/cat/cat-templates.md
@@ -18,18 +18,21 @@ The CAT Templates operation lists the names, patterns, order numbers, and versio
```
GET _cat/templates?v
```
+{% include copy-curl.html %}
If you want to get information for a specific template or pattern:
```
GET _cat/templates/
```
+{% include copy-curl.html %}
## Path and HTTP methods
```
GET _cat/templates
```
+{% include copy-curl.html %}
## URL parameters
diff --git a/_api-reference/cat/cat-thread-pool.md b/_api-reference/cat/cat-thread-pool.md
index 5355098c03b..9a48b0d017b 100644
--- a/_api-reference/cat/cat-thread-pool.md
+++ b/_api-reference/cat/cat-thread-pool.md
@@ -17,18 +17,21 @@ The CAT thread pool operation lists the active, queued, and rejected threads of
```
GET _cat/thread_pool?v
```
+{% include copy-curl.html %}
If you want to get information for more than one thread pool, separate the thread pool names with commas:
```
GET _cat/thread_pool/thread_pool_name_1,thread_pool_name_2,thread_pool_name_3
```
+{% include copy-curl.html %}
If you want to limit the information to a specific thread pool, add the thread pool name after your query:
```
GET _cat/thread_pool/?v
```
+{% include copy-curl.html %}
## Path and HTTP methods
diff --git a/_api-reference/cat/index.md b/_api-reference/cat/index.md
index 6a52863a697..6064dead8e7 100644
--- a/_api-reference/cat/index.md
+++ b/_api-reference/cat/index.md
@@ -21,6 +21,7 @@ To see the available operations in the CAT API, use the following command:
```
GET _cat
```
+{% include copy-curl.html %}
## Optional query parameters
@@ -45,6 +46,7 @@ To query aliases and get verbose output that includes all column headings in the
```json
GET _cat/aliases?v
```
+{% include copy-curl.html %}
The response provides more details, such as names of each column in the response.
diff --git a/_api-reference/cluster-allocation.md b/_api-reference/cluster-allocation.md
index b5052f628b1..bc73cfb0180 100644
--- a/_api-reference/cluster-allocation.md
+++ b/_api-reference/cluster-allocation.md
@@ -23,7 +23,7 @@ GET _cluster/allocation/explain?include_yes_decisions=true
"primary": true
}
```
-
+{% include copy-curl.html %}
## Path and HTTP methods
diff --git a/_api-reference/cluster-awareness.md b/_api-reference/cluster-awareness.md
index 2197bfd2023..e6dc7205bf8 100644
--- a/_api-reference/cluster-awareness.md
+++ b/_api-reference/cluster-awareness.md
@@ -8,7 +8,7 @@ nav_order: 16
To control the distribution of search or HTTP traffic, you can use the weights per awareness attribute to control the distribution of search or HTTP traffic across zones. This is commonly used for zonal deployments, heterogeneous instances, and routing traffic away from zones during zonal failure.
-## HTTP and path methods
+## Path and HTTP methods
```
PUT /_cluster/routing/awareness//weights
@@ -50,6 +50,7 @@ The following example request creates a round robin shard allocation for search
### Request
+```json
PUT /_cluster/routing/awareness/zone/weights
{
"weights":
@@ -60,6 +61,8 @@ PUT /_cluster/routing/awareness/zone/weights
}
"_version" : 1
}
+```
+{% include copy-curl.html %}
### Response
@@ -76,9 +79,10 @@ The following example request gets weights for all zones.
### Request
-```
+```json
GET /_cluster/routing/awareness/zone/weights
```
+{% include copy-curl.html %}
### Response
@@ -103,9 +107,10 @@ You can remove your weight ratio for each zone using the `DELETE` method.
### Request
-```
+```json
DELETE /_cluster/routing/awareness/zone/weights
```
+{% include copy-curl.html %}
### Response
diff --git a/_api-reference/cluster-decommission.md b/_api-reference/cluster-decommission.md
index 6a9a4880834..698cec7ed96 100644
--- a/_api-reference/cluster-decommission.md
+++ b/_api-reference/cluster-decommission.md
@@ -35,15 +35,17 @@ You can use the following example requests to decommission and recommission a zo
The following example request decommissions `zone-a`:
-```
+```json
PUT /_cluster/decommission/awareness//
```
+{% include copy-curl.html %}
If you want to recommission a decommissioned zone, you can use the `DELETE` method:
-```
+```json
DELETE /_cluster/decommission/awareness
```
+{% include copy-curl.html %}
### Response
@@ -60,10 +62,10 @@ The following example requests returns the decommission status of all zones.
### Request
-```
+```json
GET /_cluster/decommission/awareness/zone/_status
```
-
+{% include copy-curl.html %}
### Response
diff --git a/_api-reference/cluster-health.md b/_api-reference/cluster-health.md
index 37fcd59f9a4..a54dbea15a0 100644
--- a/_api-reference/cluster-health.md
+++ b/_api-reference/cluster-health.md
@@ -19,6 +19,7 @@ This request waits 50 seconds for the cluster to reach the yellow status or bett
```
GET _cluster/health?wait_for_status=yellow&timeout=50s
```
+{% include copy-curl.html %}
If the cluster health becomes yellow or green before 50 seconds elapse, it returns a response immediately. Otherwise it returns a response as soon as it exceeds the timeout.
@@ -56,6 +57,7 @@ The following sample request retrieves cluster health for all indexes in the clu
```json
GET _cluster/health
```
+{% include copy-curl.html %}
#### Sample response
@@ -112,6 +114,7 @@ To check cluster health by awareness attribute (for example, zone or rack), spec
```json
GET _cluster/health?level=awareness_attributes
```
+{% include copy-curl.html %}
The response contains cluster health metrics partitioned by awareness attribute:
@@ -196,6 +199,7 @@ If you're interested in a particular awareness attribute, you can include the na
```json
GET _cluster/health?level=awareness_attributes&awareness_attribute=zone
```
+{% include copy-curl.html %}
In response to the preceding request, OpenSearch returns cluster health information only for the `zone` awareness attribute.
diff --git a/_api-reference/cluster-settings.md b/_api-reference/cluster-settings.md
index 366c7422c3e..070ee59d914 100644
--- a/_api-reference/cluster-settings.md
+++ b/_api-reference/cluster-settings.md
@@ -33,6 +33,7 @@ timeout (PUT only) | Time unit | The amount of time to wait for a response from
```json
GET _cluster/settings?include_defaults=true
```
+{% include copy-curl.html %}
#### Sample response
@@ -114,6 +115,7 @@ PUT _cluster/settings
}
}
```
+{% include copy-curl.html %}
For more information about transient settings, persistent settings, and precedence, see [OpenSearch configuration]({{site.url}}{{site.baseurl}}/install-and-configure/configuration/).
diff --git a/_api-reference/cluster-stats.md b/_api-reference/cluster-stats.md
index b384b8f8927..cba70157087 100644
--- a/_api-reference/cluster-stats.md
+++ b/_api-reference/cluster-stats.md
@@ -15,6 +15,7 @@ The cluster stats API operation returns statistics about your cluster.
```json
GET _cluster/stats/nodes/_cluster_manager
```
+{% include copy-curl.html %}
## Path and HTTP methods
diff --git a/_api-reference/count.md b/_api-reference/count.md
index 34ecf978836..fd9f3113ca6 100644
--- a/_api-reference/count.md
+++ b/_api-reference/count.md
@@ -26,6 +26,7 @@ GET opensearch_dashboards_sample_data_logs/_count
}
}
```
+{% include copy-curl.html %}
The following call to the search API produces equivalent results:
@@ -41,12 +42,14 @@ GET opensearch_dashboards_sample_data_logs/_search
"track_total_hits": true
}
```
+{% include copy-curl.html %}
To see the number of documents in an index:
```json
GET opensearch_dashboards_sample_data_logs/_count
```
+{% include copy-curl.html %}
To check for the number of documents in a [data stream]({{site.url}}{{site.baseurl}}/opensearch/data-streams/), replace the index name with the data stream name.
@@ -55,6 +58,7 @@ To see the number of documents in your cluster:
```json
GET _count
```
+{% include copy-curl.html %}
Alternatively, you could use the [cat indices]({{site.url}}{{site.baseurl}}/api-reference/cat/cat-indices/) and [cat count]({{site.url}}{{site.baseurl}}/api-reference/cat/cat-count/) APIs to see the number of documents per index or data stream.
{: .note }
diff --git a/_api-reference/document-apis/bulk.md b/_api-reference/document-apis/bulk.md
index d479461684c..e7bd87324f9 100644
--- a/_api-reference/document-apis/bulk.md
+++ b/_api-reference/document-apis/bulk.md
@@ -25,6 +25,7 @@ POST _bulk
{ "doc" : { "title": "World War Z" } }
```
+{% include copy-curl.html %}
## Path and HTTP methods
diff --git a/_api-reference/document-apis/delete-by-query.md b/_api-reference/document-apis/delete-by-query.md
index a33459b0580..7622beef943 100644
--- a/_api-reference/document-apis/delete-by-query.md
+++ b/_api-reference/document-apis/delete-by-query.md
@@ -23,6 +23,7 @@ POST sample-index1/_delete_by_query
}
}
```
+{% include copy-curl.html %}
## Path and HTTP methods
diff --git a/_api-reference/document-apis/delete-document.md b/_api-reference/document-apis/delete-document.md
index 2c20e7248bc..e98a651193f 100644
--- a/_api-reference/document-apis/delete-document.md
+++ b/_api-reference/document-apis/delete-document.md
@@ -16,6 +16,7 @@ If you no longer need a document in your index, you can use the delete document
```
DELETE /sample-index1/_doc/1
```
+{% include copy-curl.html %}
## Path and HTTP methods
diff --git a/_api-reference/document-apis/get-documents.md b/_api-reference/document-apis/get-documents.md
index 92a75692b91..6e541606dd4 100644
--- a/_api-reference/document-apis/get-documents.md
+++ b/_api-reference/document-apis/get-documents.md
@@ -16,6 +16,7 @@ After adding a JSON document to your index, you can use the get document API ope
```json
GET sample-index1/_doc/1
```
+{% include copy-curl.html %}
## Path and HTTP methods
diff --git a/_api-reference/document-apis/index-document.md b/_api-reference/document-apis/index-document.md
index e681b74b376..b9eb53dbcc5 100644
--- a/_api-reference/document-apis/index-document.md
+++ b/_api-reference/document-apis/index-document.md
@@ -19,6 +19,7 @@ PUT sample-index/_doc/1
"Description": "To be or not to be, that is the question."
}
```
+{% include copy-curl.html %}
## Path and HTTP methods
diff --git a/_api-reference/document-apis/multi-get.md b/_api-reference/document-apis/multi-get.md
index 5ff3b9ff453..e2dd6e451a0 100644
--- a/_api-reference/document-apis/multi-get.md
+++ b/_api-reference/document-apis/multi-get.md
@@ -31,6 +31,7 @@ GET _mget
]
}
```
+{% include copy-curl.html %}
## Example of specifying index in URL
@@ -50,6 +51,7 @@ GET sample-index1/_mget
]
}
```
+{% include copy-curl.html %}
## Path and HTTP methods
diff --git a/_api-reference/document-apis/reindex.md b/_api-reference/document-apis/reindex.md
index a24c739ef02..93aef5dac59 100644
--- a/_api-reference/document-apis/reindex.md
+++ b/_api-reference/document-apis/reindex.md
@@ -24,6 +24,7 @@ POST /_reindex
}
}
```
+{% include copy-curl.html %}
## Path and HTTP methods
diff --git a/_api-reference/document-apis/update-by-query.md b/_api-reference/document-apis/update-by-query.md
index 51bb27e8a62..4af274b1523 100644
--- a/_api-reference/document-apis/update-by-query.md
+++ b/_api-reference/document-apis/update-by-query.md
@@ -30,6 +30,7 @@ POST test-index1/_update_by_query
}
}
```
+{% include copy-curl.html %}
## Path and HTTP methods
diff --git a/_api-reference/document-apis/update-document.md b/_api-reference/document-apis/update-document.md
index 7dcc47b7e06..e2694f7fe30 100644
--- a/_api-reference/document-apis/update-document.md
+++ b/_api-reference/document-apis/update-document.md
@@ -22,6 +22,7 @@ POST /sample-index1/_update/1
}
}
```
+{% include copy-curl.html %}
## Script example
@@ -33,6 +34,7 @@ POST /test-index1/_update/1
}
}
```
+{% include copy-curl.html %}
## Path and HTTP methods
diff --git a/_api-reference/explain.md b/_api-reference/explain.md
index 4398970f948..2d79baefbe3 100644
--- a/_api-reference/explain.md
+++ b/_api-reference/explain.md
@@ -30,6 +30,7 @@ POST opensearch_dashboards_sample_data_ecommerce/_search?explain=true
}
}
```
+{% include copy-curl.html %}
More often, you want the output for a single document. In that case, specify the document ID in the URL:
@@ -43,6 +44,7 @@ POST opensearch_dashboards_sample_data_ecommerce/_explain/EVz1Q3sBgg5eWQP6RSte
}
}
```
+{% include copy-curl.html %}
## Path and HTTP methods
diff --git a/_api-reference/index-apis/clear-index-cache.md b/_api-reference/index-apis/clear-index-cache.md
index 42885831fa1..f44504a944a 100644
--- a/_api-reference/index-apis/clear-index-cache.md
+++ b/_api-reference/index-apis/clear-index-cache.md
@@ -46,6 +46,7 @@ The following request clears the fields cache only:
````json
POST /my-index/_cache/clear?fielddata=true
````
+{% include copy-curl.html %}
@@ -54,6 +55,7 @@ The following request clears the query cache only:
````json
POST /my-index/_cache/clear?query=true
````
+{% include copy-curl.html %}
@@ -62,6 +64,7 @@ The following request clears the request cache only:
````json
POST /my-index/_cache/clear?request=true
````
+{% include copy-curl.html %}
##### Clear the cache for specific fields
@@ -70,6 +73,7 @@ The following request clears the fields caches of `fielda` and `fieldb`:
````json
POST /my-index/_cache/clear?fields=fielda,fieldb
````
+{% include copy-curl.html %}
##### Clear caches for specific data streams and indexes
@@ -78,6 +82,7 @@ The following request clears the cache for two specific indexes:
````json
POST /my-index,my-index2/_cache/clear
````
+{% include copy-curl.html %}
##### Clear caches for all data streams and indexes
@@ -86,6 +91,7 @@ The following request clears the cache for all data streams and indexes:
````json
POST /_cache/clear
````
+{% include copy-curl.html %}
#### Sample response
diff --git a/_api-reference/index-apis/clone.md b/_api-reference/index-apis/clone.md
index a9fa7cf8545..07391ce8f1e 100644
--- a/_api-reference/index-apis/clone.md
+++ b/_api-reference/index-apis/clone.md
@@ -25,6 +25,7 @@ PUT /sample-index1/_clone/cloned-index1
}
}
```
+{% include copy-curl.html %}
## Path and HTTP methods
diff --git a/_api-reference/index-apis/close-index.md b/_api-reference/index-apis/close-index.md
index 7ed65e9e618..a914a7ea677 100644
--- a/_api-reference/index-apis/close-index.md
+++ b/_api-reference/index-apis/close-index.md
@@ -16,6 +16,7 @@ The close index API operation closes an index. Once an index is closed, you cann
```json
POST /sample-index/_close
```
+{% include copy-curl.html %}
## Path and HTTP methods
diff --git a/_api-reference/index-apis/dangling-index.md b/_api-reference/index-apis/dangling-index.md
index a34c5bf0238..f654b108141 100644
--- a/_api-reference/index-apis/dangling-index.md
+++ b/_api-reference/index-apis/dangling-index.md
@@ -56,12 +56,14 @@ The following are sample requests and a sample response.
````bash
GET /_dangling
````
+{% include copy-curl.html %}
#### Sample import
````bash
POST /_dangling/msdjernajxAT23RT-BupMB?accept_data_loss=true
````
+{% include copy-curl.html %}
#### Sample delete
diff --git a/_api-reference/index-apis/delete-index.md b/_api-reference/index-apis/delete-index.md
index f66b415ae9b..e938b5ea7c2 100644
--- a/_api-reference/index-apis/delete-index.md
+++ b/_api-reference/index-apis/delete-index.md
@@ -16,6 +16,7 @@ If you no longer need an index, you can use the delete index API operation to de
```json
DELETE /sample-index
```
+{% include copy-curl.html %}
## Path and HTTP methods
diff --git a/_api-reference/index-apis/exists.md b/_api-reference/index-apis/exists.md
index 2b2407b87be..45e68793bbb 100644
--- a/_api-reference/index-apis/exists.md
+++ b/_api-reference/index-apis/exists.md
@@ -16,6 +16,7 @@ The index exists API operation returns whether or not an index already exists.
```json
HEAD /sample-index
```
+{% include copy-curl.html %}
## Path and HTTP methods
diff --git a/_api-reference/index-apis/get-index.md b/_api-reference/index-apis/get-index.md
index 3a45fd0a234..60b5976d18e 100644
--- a/_api-reference/index-apis/get-index.md
+++ b/_api-reference/index-apis/get-index.md
@@ -16,6 +16,7 @@ You can use the get index API operation to return information about an index.
```json
GET /sample-index
```
+{% include copy-curl.html %}
## Path and HTTP methods
diff --git a/_api-reference/index-apis/get-settings.md b/_api-reference/index-apis/get-settings.md
index 4974ea50901..6fa558a7609 100644
--- a/_api-reference/index-apis/get-settings.md
+++ b/_api-reference/index-apis/get-settings.md
@@ -16,6 +16,7 @@ The get settings API operation returns all the settings in your index.
```json
GET /sample-index1/_settings
```
+{% include copy-curl.html %}
## Path and HTTP methods
diff --git a/_api-reference/index-apis/open-index.md b/_api-reference/index-apis/open-index.md
index fa2c8e73bc1..9df21b597cf 100644
--- a/_api-reference/index-apis/open-index.md
+++ b/_api-reference/index-apis/open-index.md
@@ -16,6 +16,7 @@ The open index API operation opens a closed index, letting you add or search for
```json
POST /sample-index/_open
```
+{% include copy-curl.html %}
## Path and HTTP methods
diff --git a/_api-reference/index-apis/put-mapping.md b/_api-reference/index-apis/put-mapping.md
index db06d32c758..7bf9b243e74 100644
--- a/_api-reference/index-apis/put-mapping.md
+++ b/_api-reference/index-apis/put-mapping.md
@@ -78,6 +78,7 @@ PUT /sample-index/_mapping
}
}
```
+{% include copy-curl.html %}
#### Sample Response
diff --git a/_api-reference/index-apis/shrink-index.md b/_api-reference/index-apis/shrink-index.md
index 3a723914873..ede32764e66 100644
--- a/_api-reference/index-apis/shrink-index.md
+++ b/_api-reference/index-apis/shrink-index.md
@@ -23,6 +23,7 @@ POST /my-old-index/_shrink/my-new-index
}
}
```
+{% include copy-curl.html %}
## Path and HTTP methods
diff --git a/_api-reference/index-apis/split.md b/_api-reference/index-apis/split.md
index 03c9ec41831..96032d0915e 100644
--- a/_api-reference/index-apis/split.md
+++ b/_api-reference/index-apis/split.md
@@ -25,6 +25,7 @@ PUT /sample-index1/_split/split-index1
}
}
```
+{% include copy-curl.html %}
## Path and HTTP methods
diff --git a/_api-reference/index-apis/update-settings.md b/_api-reference/index-apis/update-settings.md
index 410e6bd92b8..fd507fd19d7 100644
--- a/_api-reference/index-apis/update-settings.md
+++ b/_api-reference/index-apis/update-settings.md
@@ -24,6 +24,7 @@ PUT /sample-index1/_settings
}
}
```
+{% include copy-curl.html %}
## Path and HTTP methods
diff --git a/_api-reference/ingest-apis/create-update-ingest.md b/_api-reference/ingest-apis/create-update-ingest.md
index 767c747411c..03e5d1f3fd7 100644
--- a/_api-reference/ingest-apis/create-update-ingest.md
+++ b/_api-reference/ingest-apis/create-update-ingest.md
@@ -25,6 +25,7 @@ PUT _ingest/pipeline/12345
]
}
```
+{% include copy-curl.html %}
## Path and HTTP methods
```
diff --git a/_api-reference/ingest-apis/delete-ingest.md b/_api-reference/ingest-apis/delete-ingest.md
index 1dcae3c87d2..0f2b6e950c6 100644
--- a/_api-reference/ingest-apis/delete-ingest.md
+++ b/_api-reference/ingest-apis/delete-ingest.md
@@ -14,6 +14,7 @@ If you no longer want to use an ingest pipeline, use the delete ingest pipeline
```
DELETE _ingest/pipeline/12345
```
+{% include copy-curl.html %}
## Path and HTTP methods
diff --git a/_api-reference/ingest-apis/get-ingest.md b/_api-reference/ingest-apis/get-ingest.md
index b91838df4a6..c92d8e5101e 100644
--- a/_api-reference/ingest-apis/get-ingest.md
+++ b/_api-reference/ingest-apis/get-ingest.md
@@ -14,6 +14,7 @@ After you create a pipeline, use the get ingest pipeline API operation to return
```
GET _ingest/pipeline/12345
```
+{% include copy-curl.html %}
## Path and HTTP methods
diff --git a/_api-reference/ingest-apis/simulate-ingest.md b/_api-reference/ingest-apis/simulate-ingest.md
index e37304aa48b..db22336aa5b 100644
--- a/_api-reference/ingest-apis/simulate-ingest.md
+++ b/_api-reference/ingest-apis/simulate-ingest.md
@@ -32,6 +32,7 @@ POST /_ingest/pipeline/35678/_simulate
]
}
```
+{% include copy-curl.html %}
## Path and HTTP methods
diff --git a/_api-reference/multi-search.md b/_api-reference/multi-search.md
index 1680fe73b0a..b895f0c5f0b 100644
--- a/_api-reference/multi-search.md
+++ b/_api-reference/multi-search.md
@@ -21,6 +21,7 @@ GET _msearch
{ "query": { "match_all": {} } }
```
+{% include copy-curl.html %}
## Path and HTTP methods
diff --git a/_api-reference/nodes-apis/index.md b/_api-reference/nodes-apis/index.md
index 2a93233c4de..c6574f96615 100644
--- a/_api-reference/nodes-apis/index.md
+++ b/_api-reference/nodes-apis/index.md
@@ -50,12 +50,14 @@ To get statistics from the elected cluster manager node only, use the following
```json
GET /_nodes/_cluster_manager/stats
```
+{% include copy-curl.html %}
To get statistics from nodes that are data-only nodes, use the following query:
```json
GET /_nodes/data:true/stats
```
+{% include copy-curl.html %}
### Order of resolution mechanisms
@@ -66,9 +68,11 @@ To get statistics from all the nodes except the cluster manager node, use the fo
```json
GET /_nodes/_all,cluster_manager:false/stats
```
+{% include copy-curl.html %}
However, if you switch the resolution mechanisms, the result will include all the cluster nodes, including the cluster manager node:
```json
GET /_nodes/cluster_manager:false,_all/stats
-```
\ No newline at end of file
+```
+{% include copy-curl.html %}
\ No newline at end of file
diff --git a/_api-reference/nodes-apis/nodes-hot-threads.md b/_api-reference/nodes-apis/nodes-hot-threads.md
index 98a12e3bee8..23019d800fd 100644
--- a/_api-reference/nodes-apis/nodes-hot-threads.md
+++ b/_api-reference/nodes-apis/nodes-hot-threads.md
@@ -14,6 +14,7 @@ The nodes hot threads endpoint provides information about busy JVM threads for s
```json
GET /_nodes/hot_threads
```
+{% include copy-curl.html %}
## Path and HTTP methods
@@ -48,6 +49,7 @@ timeout | Time | Sets the time limit for node response. Default value is `30s`.
```json
GET /_nodes/hot_threads
```
+{% include copy-curl.html %}
#### Sample response
diff --git a/_api-reference/nodes-apis/nodes-info.md b/_api-reference/nodes-apis/nodes-info.md
index e2469f1336f..b04f06ec46d 100644
--- a/_api-reference/nodes-apis/nodes-info.md
+++ b/_api-reference/nodes-apis/nodes-info.md
@@ -23,12 +23,14 @@ To get information about all nodes in a cluster, use the following query:
```json
GET /_nodes
```
+{% include copy-curl.html %}
To get thread pool information about the cluster manager node only, use the following query:
```json
GET /_nodes/master:true/thread_pool
```
+{% include copy-curl.html %}
## Path and HTTP methods
@@ -82,6 +84,7 @@ The following query requests the `process` and `transport` metrics from the clus
```json
GET /_nodes/cluster_manager:true/process,transport
```
+{% include copy-curl.html %}
#### Sample response
diff --git a/_api-reference/nodes-apis/nodes-reload-secure.md b/_api-reference/nodes-apis/nodes-reload-secure.md
index 24415ce3386..467df77060e 100644
--- a/_api-reference/nodes-apis/nodes-reload-secure.md
+++ b/_api-reference/nodes-apis/nodes-reload-secure.md
@@ -41,6 +41,7 @@ The following is an example API request:
```
POST _nodes/reload_secure_settings
```
+{% include copy-curl.html %}
#### Sample response
diff --git a/_api-reference/nodes-apis/nodes-stats.md b/_api-reference/nodes-apis/nodes-stats.md
index f582a67be2c..fbd0511bfb7 100644
--- a/_api-reference/nodes-apis/nodes-stats.md
+++ b/_api-reference/nodes-apis/nodes-stats.md
@@ -57,6 +57,7 @@ GET _nodes/stats/
GET _nodes/stats/_all
GET _nodes/stats/indices
```
+
The following index metrics are supported:
- docs
@@ -80,6 +81,7 @@ For example, the following query requests statistics for `docs` and `search`:
```json
GET _nodes/stats/indices/docs,search
```
+{% include copy-curl.html %}
## Query parameters
@@ -100,6 +102,7 @@ include_segment_file_sizes | Boolean | If segment statistics are requested, this
```json
GET _nodes/stats/
```
+{% include copy-curl.html %}
#### Sample response
diff --git a/_api-reference/nodes-apis/nodes-usage.md b/_api-reference/nodes-apis/nodes-usage.md
index 5cfa25b77b0..d9a1af24495 100644
--- a/_api-reference/nodes-apis/nodes-usage.md
+++ b/_api-reference/nodes-apis/nodes-usage.md
@@ -43,6 +43,7 @@ The following request returns usage details for all nodes:
```
GET _nodes/usage
```
+{% include copy-curl.html %}
#### Sample response
diff --git a/_api-reference/rank-eval.md b/_api-reference/rank-eval.md
index 5ed5ca6261c..f2c5d931b8b 100644
--- a/_api-reference/rank-eval.md
+++ b/_api-reference/rank-eval.md
@@ -72,6 +72,7 @@ GET shakespeare/_rank_eval
]
}
````
+{% include copy-curl.html %}
#### Sample response
diff --git a/_api-reference/reload-search-analyzer.md b/_api-reference/reload-search-analyzer.md
index 291efe6712e..d8e217396f8 100644
--- a/_api-reference/reload-search-analyzer.md
+++ b/_api-reference/reload-search-analyzer.md
@@ -34,6 +34,7 @@ The following are an example request and response.
````json
POST /shakespeare/_reload_search_analyzers
````
+{% include copy-curl.html %}
#### Sample response
diff --git a/_api-reference/remote-info.md b/_api-reference/remote-info.md
index 9275459d08e..9f2e702923a 100644
--- a/_api-reference/remote-info.md
+++ b/_api-reference/remote-info.md
@@ -18,7 +18,7 @@ The response is more comprehensive and useful than a call to `_cluster/settings`
```
GET _remote/info
```
-
+{% include copy-curl.html %}
## Response
diff --git a/_api-reference/script-apis/create-stored-script.md b/_api-reference/script-apis/create-stored-script.md
index 1f73b09ed86..f50e6d504ce 100644
--- a/_api-reference/script-apis/create-stored-script.md
+++ b/_api-reference/script-apis/create-stored-script.md
@@ -75,6 +75,8 @@ PUT _scripts/my-first-script
}
}
````
+{% include copy.html %}
+
The example above uses the syntax of the Dev Tools console in OpenSearch Dashboards. You can also use a curl request.
{: .note }
@@ -89,6 +91,7 @@ curl -XPUT "http://opensearch:9200/_scripts/my-first-script" -H 'Content-Type: a
}
}'
````
+{% include copy.html %}
See [Execute Painless stored script]({{site.url}}{{site.baseurl}}/api-reference/script-apis/exec-stored-script/) for information about running the script.
diff --git a/_api-reference/script-apis/delete-script.md b/_api-reference/script-apis/delete-script.md
index 2c075ac2706..be53a08182a 100644
--- a/_api-reference/script-apis/delete-script.md
+++ b/_api-reference/script-apis/delete-script.md
@@ -31,6 +31,7 @@ The following request deletes the `my-first-script` script:
````json
DELETE _scripts/my-script
````
+{% include copy-curl.html %}
#### Sample response
diff --git a/_api-reference/script-apis/exec-script.md b/_api-reference/script-apis/exec-script.md
index 30aa8e47a08..073eae4bcca 100644
--- a/_api-reference/script-apis/exec-script.md
+++ b/_api-reference/script-apis/exec-script.md
@@ -40,6 +40,7 @@ GET /_scripts/painless/_execute
}
}
```
+{% include copy-curl.html %}
#### Sample response
@@ -94,6 +95,7 @@ PUT /testindex1
}
}
```
+{% include copy-curl.html %}
Run a script to determine if a student is eligible to graduate with honors:
@@ -116,6 +118,7 @@ POST /_scripts/painless/_execute
}
}
```
+{% include copy-curl.html %}
The response contains the result:
@@ -151,6 +154,7 @@ PUT /testindex1
}
}
```
+{% include copy-curl.html %}
Run a script that converts a GPA on a 4.0 scale into a different scale that is provided as a parameter:
@@ -172,6 +176,7 @@ POST /_scripts/painless/_execute
}
}
```
+{% include copy-curl.html %}
The response contains the result:
diff --git a/_api-reference/script-apis/exec-stored-script.md b/_api-reference/script-apis/exec-stored-script.md
index cbef9baa993..9a640365a54 100644
--- a/_api-reference/script-apis/exec-stored-script.md
+++ b/_api-reference/script-apis/exec-stored-script.md
@@ -44,6 +44,7 @@ GET books/_search
}
}
````
+{% include copy-curl.html %}
#### Sample response
diff --git a/_api-reference/script-apis/get-script-contexts.md b/_api-reference/script-apis/get-script-contexts.md
index 679893a84a2..e39dadc0dff 100644
--- a/_api-reference/script-apis/get-script-contexts.md
+++ b/_api-reference/script-apis/get-script-contexts.md
@@ -14,6 +14,7 @@ Retrieves all contexts for stored scripts.
````json
GET _script_context
````
+{% include copy-curl.html %}
#### Sample response
diff --git a/_api-reference/script-apis/get-script-language.md b/_api-reference/script-apis/get-script-language.md
index 2a94b225a8b..1405191ea28 100644
--- a/_api-reference/script-apis/get-script-language.md
+++ b/_api-reference/script-apis/get-script-language.md
@@ -14,6 +14,7 @@ The get script language API operation retrieves all supported script languages a
```json
GET _script_language
```
+{% include copy-curl.html %}
#### Sample response
diff --git a/_api-reference/script-apis/get-stored-script.md b/_api-reference/script-apis/get-stored-script.md
index b781f79484f..35eba7b2e6a 100644
--- a/_api-reference/script-apis/get-stored-script.md
+++ b/_api-reference/script-apis/get-stored-script.md
@@ -28,6 +28,7 @@ The following retrieves the `my-first-script` stored script.
````json
GET _scripts/my-first-script
````
+{% include copy-curl.html %}
#### Sample response
diff --git a/_api-reference/scroll.md b/_api-reference/scroll.md
index 96b4cc2ed7f..4f373627c52 100644
--- a/_api-reference/scroll.md
+++ b/_api-reference/scroll.md
@@ -25,6 +25,7 @@ GET shakespeare/_search?scroll=10m
"size": 10000
}
```
+{% include copy-curl.html %}
OpenSearch caches the results and returns a scroll ID to access them in batches:
@@ -41,6 +42,7 @@ GET _search/scroll
"scroll_id": "DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAAUWdmpUZDhnRFBUcWFtV21nMmFwUGJEQQ=="
}
```
+{% include copy-curl.html %}
Using this scroll ID, you get results in batches of 10,000 as long as the search context is still open. Typically, the scroll ID does not change between requests, but it *can* change, so make sure to always use the latest scroll ID. If you don't send the next scroll request within the set search context, the `scroll` operation does not return any results.
@@ -59,6 +61,7 @@ GET shakespeare/_search?scroll=10m
}
}
```
+{% include copy-curl.html %}
With a single scroll ID, you get back 10 results.
You can have up to 10 IDs.
@@ -68,12 +71,14 @@ Close the search context when you’re done scrolling, because the `scroll` oper
```json
DELETE _search/scroll/DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAAcWdmpUZDhnRFBUcWFtV21nMmFwUGJEQQ==
```
+{% include copy-curl.html %}
To close all open scroll contexts:
```json
DELETE _search/scroll/_all
```
+{% include copy-curl.html %}
The `scroll` operation corresponds to a specific timestamp. It doesn't consider documents added after that timestamp as potential results.
diff --git a/_api-reference/search.md b/_api-reference/search.md
index aaff20b6675..4422afa50f0 100644
--- a/_api-reference/search.md
+++ b/_api-reference/search.md
@@ -22,6 +22,7 @@ GET /movies/_search
}
}
```
+{% include copy-curl.html %}
## Path and HTTP Methods
diff --git a/_api-reference/snapshots/create-repository.md b/_api-reference/snapshots/create-repository.md
index 912bdfb1714..22c96152e16 100644
--- a/_api-reference/snapshots/create-repository.md
+++ b/_api-reference/snapshots/create-repository.md
@@ -73,6 +73,7 @@ PUT _snapshot/my-opensearch-repo
}
}
```
+{% include copy-curl.html %}
#### Sample response
diff --git a/_api-reference/snapshots/create-snapshot.md b/_api-reference/snapshots/create-snapshot.md
index d4c720bb195..f0cbed4ac3b 100644
--- a/_api-reference/snapshots/create-snapshot.md
+++ b/_api-reference/snapshots/create-snapshot.md
@@ -53,6 +53,7 @@ The following request creates a snapshot called `my-first-snapshot` in an S3 rep
```json
POST _snapshot/my-s3-repository/my-first-snapshot
```
+{% include copy-curl.html %}
##### Request with a body
@@ -67,6 +68,7 @@ PUT _snapshot/my-s3-repository/2
"partial": false
}
```
+{% include copy-curl.html %}
#### Sample responses
@@ -120,6 +122,7 @@ The snapshot definition is returned.
}
}
```
+
#### Response fields
| Field | Data type | Description |
diff --git a/_api-reference/snapshots/delete-snapshot-repository.md b/_api-reference/snapshots/delete-snapshot-repository.md
index 440e0311aae..49173bc6255 100644
--- a/_api-reference/snapshots/delete-snapshot-repository.md
+++ b/_api-reference/snapshots/delete-snapshot-repository.md
@@ -26,6 +26,7 @@ The following request deletes the `my-opensearch-repo` repository:
````json
DELETE _snapshot/my-opensearch-repo
````
+{% include copy-curl.html %}
#### Sample response
diff --git a/_api-reference/snapshots/delete-snapshot.md b/_api-reference/snapshots/delete-snapshot.md
index 67b3627197d..a3f896e7c13 100644
--- a/_api-reference/snapshots/delete-snapshot.md
+++ b/_api-reference/snapshots/delete-snapshot.md
@@ -24,9 +24,12 @@ snapshot | String | Snapshot to delete. |
#### Sample request
-The following request deletes a snapshot called `my-first-snapshot` from the `my-opensearch-repo` repository.
+The following request deletes a snapshot called `my-first-snapshot` from the `my-opensearch-repo` repository:
-`DELETE _snapshot/my-opensearch-repo/my-first-snapshot`
+```json
+DELETE _snapshot/my-opensearch-repo/my-first-snapshot
+```
+{% include copy-curl.html %}
#### Sample response
diff --git a/_api-reference/snapshots/get-snapshot-repository.md b/_api-reference/snapshots/get-snapshot-repository.md
index da30dbc4766..d365b93dfe1 100644
--- a/_api-reference/snapshots/get-snapshot-repository.md
+++ b/_api-reference/snapshots/get-snapshot-repository.md
@@ -34,6 +34,7 @@ The following request retrieves information for the `my-opensearch-repo` reposit
````json
GET /_snapshot/my-opensearch-repo
````
+{% include copy-curl.html %}
#### Sample response
diff --git a/_api-reference/snapshots/get-snapshot-status.md b/_api-reference/snapshots/get-snapshot-status.md
index ba9e51345a9..a79c3c14d28 100644
--- a/_api-reference/snapshots/get-snapshot-status.md
+++ b/_api-reference/snapshots/get-snapshot-status.md
@@ -50,6 +50,7 @@ GET _snapshot/my-opensearch-repo/my-first-snapshot/_status
"ignore_unavailable": true
}
````
+{% include copy-curl.html %}
#### Sample response
diff --git a/_api-reference/snapshots/get-snapshot.md b/_api-reference/snapshots/get-snapshot.md
index 89bda2d2515..f65a43eb78a 100644
--- a/_api-reference/snapshots/get-snapshot.md
+++ b/_api-reference/snapshots/get-snapshot.md
@@ -30,6 +30,7 @@ The following request retrieves information for the `my-first-snapshot` located
````json
GET _snapshot/my-opensearch-repo/my-first-snapshot
````
+{% include copy-curl.html %}
#### Sample response
diff --git a/_api-reference/tasks.md b/_api-reference/tasks.md
index 029c2415b79..54dbe62a221 100644
--- a/_api-reference/tasks.md
+++ b/_api-reference/tasks.md
@@ -15,12 +15,14 @@ The following request returns information about all of your tasks:
```
GET _tasks
```
+{% include copy-curl.html %}
By including a task ID, you can get information specific to a particular task. Note that a task ID consists of a node's identifying string and the task's numerical ID. For example, if your node's identifying string is `nodestring` and the task's numerical ID is `1234`, then your task ID is `nodestring:1234`. You can find this information by running the `tasks` operation:
```
GET _tasks/
```
+{% include copy-curl.html %}
Note that if a task finishes running, it won't be returned as part of your request. For an example of a task that takes a little longer to finish, you can run the [`_reindex`]({{site.url}}{{site.baseurl}}/opensearch/reindex-data) API operation on a larger document, and then run `tasks`.
@@ -77,6 +79,7 @@ Note that if a task finishes running, it won't be returned as part of your reque
}
}
```
+
You can also use the following parameters with your query.
Parameter | Data type | Description |
@@ -97,6 +100,7 @@ For example, this request returns tasks currently running on a node named `opens
```
GET /_tasks?nodes=opensearch-node1
```
+{% include copy-curl.html %}
**Sample Response**
@@ -149,6 +153,7 @@ The following request will return detailed information about active search tasks
```bash
curl -XGET "localhost:9200/_tasks?actions=*search&detailed
```
+{% include copy.html %}
**Sample Response**
@@ -203,6 +208,7 @@ After getting a list of tasks, you can cancel all cancelable tasks with the foll
```
POST _tasks/_cancel
```
+{% include copy-curl.html %}
Note that not all tasks are cancelable. To see if a task is cancelable, refer to the `cancellable` field in the response to your `tasks` API request.
@@ -211,12 +217,14 @@ You can also cancel a task by including a specific task ID.
```
POST _tasks//_cancel
```
+{% include copy-curl.html %}
The `cancel` operation supports the same parameters as the `tasks` operation. The following example shows how to cancel all cancelable tasks on multiple nodes.
```
POST _tasks/_cancel?nodes=opensearch-node1,opensearch-node2
```
+{% include copy-curl.html %}
## Attaching headers to tasks
@@ -227,6 +235,7 @@ Usage:
```bash
curl -i -H "X-Opaque-Id: 111111" "https://localhost:9200/_tasks" -u 'admin:admin' --insecure
```
+{% include copy.html %}
The `_tasks` operation returns the following result.
@@ -284,4 +293,5 @@ This operation supports the same parameters as the `tasks` operation. The follow
```bash
curl -i -H "X-Opaque-Id: 123456" "https://localhost:9200/_tasks?nodes=opensearch-node1" -u 'admin:admin' --insecure
-```
\ No newline at end of file
+```
+{% include copy.html %}
\ No newline at end of file
diff --git a/_opensearch/supported-field-types/alias.md b/_opensearch/supported-field-types/alias.md
index 61650763e13..f128ef65704 100644
--- a/_opensearch/supported-field-types/alias.md
+++ b/_opensearch/supported-field-types/alias.md
@@ -28,6 +28,7 @@ PUT movies
}
}
```
+{% include copy-curl.html %}
## Parameters
@@ -70,6 +71,7 @@ To use an alias in the field capabilities API, specify it in the fields paramete
```json
GET movies/_field_caps?fields=release_date
```
+{% include copy-curl.html %}
## Exceptions
@@ -87,3 +89,4 @@ In search and field capabilities wildcard queries, both the original field and t
```json
GET movies/_field_caps?fields=release*
```
+{% include copy-curl.html %}
\ No newline at end of file
diff --git a/_opensearch/supported-field-types/binary.md b/_opensearch/supported-field-types/binary.md
index 4e2d64ae864..2bc95c31ab1 100644
--- a/_opensearch/supported-field-types/binary.md
+++ b/_opensearch/supported-field-types/binary.md
@@ -26,6 +26,7 @@ PUT testindex
}
}
```
+{% include copy-curl.html %}
Index a document with a binary value:
@@ -35,6 +36,7 @@ PUT testindex/_doc/1
"binary_value" : "bGlkaHQtd29rfx4="
}
```
+{% include copy-curl.html %}
Use `=` as a padding character. Embedded newline characters are not allowed.
{: .note }
diff --git a/_opensearch/supported-field-types/boolean.md b/_opensearch/supported-field-types/boolean.md
index bccae2138f4..40affbde382 100644
--- a/_opensearch/supported-field-types/boolean.md
+++ b/_opensearch/supported-field-types/boolean.md
@@ -32,6 +32,7 @@ PUT testindex
}
}
```
+{% include copy-curl.html %}
Index a document with Boolean values:
@@ -43,6 +44,7 @@ PUT testindex/_doc/1
"c" : ""
}
```
+{% include copy-curl.html %}
As a result, `a` and `b` will be set to `true`, and `c` will be set to `false`.
@@ -58,6 +60,7 @@ GET testindex/_search
}
}
```
+{% include copy-curl.html %}
## Parameters
@@ -100,6 +103,7 @@ GET testindex/_search
}
}
```
+{% include copy-curl.html %}
The script returns the value of `a` as `true`, `key` returns the value of `a` as `1`, and `key_as_string` returns the value of `a` as `"true"`:
diff --git a/_opensearch/supported-field-types/completion.md b/_opensearch/supported-field-types/completion.md
index 29d239ef307..2f3123af853 100644
--- a/_opensearch/supported-field-types/completion.md
+++ b/_opensearch/supported-field-types/completion.md
@@ -30,6 +30,7 @@ PUT chess_store
}
}
```
+{% include copy-curl.html %}
Index suggestions into OpenSearch:
@@ -42,6 +43,7 @@ PUT chess_store/_doc/1
}
}
```
+{% include copy-curl.html %}
## Parameters
@@ -73,6 +75,7 @@ PUT chess_store/_doc/2
]
}
```
+{% include copy-curl.html %}
As an alternative, you can use the following shorthand notation (note that you cannot provide the `weight` parameter in this notation):
@@ -82,6 +85,7 @@ PUT chess_store/_doc/3
"suggestions" : [ "Chess clock", "Chess timer" ]
}
```
+{% include copy-curl.html %}
## Querying completion field types
@@ -102,6 +106,7 @@ GET chess_store/_search
}
}
```
+{% include copy-curl.html %}
The response contains autocomplete suggestions:
@@ -192,6 +197,7 @@ GET chess_store/_search
}
}
```
+{% include copy-curl.html %}
The response contains the suggestions:
@@ -297,6 +303,7 @@ GET chess_store/_search
}
}
```
+{% include copy-curl.html %}
To use all default fuzziness options, specify `"fuzzy": {}` or `"fuzzy": true`.
{: .tip}
@@ -330,6 +337,7 @@ GET chess_store/_search
}
}
```
+{% include copy-curl.html %}
The response matches the string "abcde":
diff --git a/_opensearch/supported-field-types/date.md b/_opensearch/supported-field-types/date.md
index b093a56a02f..9195fbbb3a9 100644
--- a/_opensearch/supported-field-types/date.md
+++ b/_opensearch/supported-field-types/date.md
@@ -34,6 +34,7 @@ PUT testindex
}
}
```
+{% include copy-curl.html %}
## Parameters
@@ -168,6 +169,7 @@ PUT testindex
}
}
```
+{% include copy-curl.html %}
Index a document with a date:
@@ -177,6 +179,7 @@ PUT testindex/_doc/21
"release_date" : "03/21/2019"
}
```
+{% include copy-curl.html %}
When searching for an exact date, provide that date in the same format:
@@ -192,6 +195,7 @@ GET testindex/_search
}
}
```
+{% include copy-curl.html %}
Range queries by default use the field's mapped format. You can also specify the range of dates in a different format by providing the `format` parameter:
@@ -209,6 +213,7 @@ GET testindex/_search
}
}
```
+{% include copy-curl.html %}
## Date math
@@ -263,6 +268,7 @@ PUT testindex
}
}
```
+{% include copy-curl.html %}
Index two documents into the index:
@@ -271,12 +277,16 @@ PUT testindex/_doc/1
{
"release_date": "2022-09-14"
}
+```
+{% include copy-curl.html %}
+```json
PUT testindex/_doc/2
{
"release_date": "2022-11-15"
}
```
+{% include copy-curl.html %}
The following query searches for documents with `release_date` within 2 months and 1 day of 09/14/2022. The lower boundary of the range is rounded to the beginning of the day on 09/14/2022:
@@ -293,6 +303,7 @@ GET testindex/_search
}
}
```
+{% include copy-curl.html %}
The response contains both documents:
diff --git a/_opensearch/supported-field-types/geo-point.md b/_opensearch/supported-field-types/geo-point.md
index 99c91c5445d..c686907f92b 100644
--- a/_opensearch/supported-field-types/geo-point.md
+++ b/_opensearch/supported-field-types/geo-point.md
@@ -27,6 +27,7 @@ PUT testindex1
}
}
```
+{% include copy-curl.html %}
## Formats
@@ -43,6 +44,7 @@ PUT testindex1/_doc/1
}
}
```
+{% include copy-curl.html %}
- A string in the "`latitude`,`longitude`" format
@@ -52,6 +54,7 @@ PUT testindex1/_doc/2
"point": "40.71,74.00"
}
```
+{% include copy-curl.html %}
- A geohash
@@ -61,6 +64,7 @@ PUT testindex1/_doc/3
"point": "txhxegj0uyp3"
}
```
+{% include copy-curl.html %}
- An array in the [`longitude`, `latitude`] format
@@ -70,6 +74,7 @@ PUT testindex1/_doc/4
"point": [74.00, 40.71]
}
```
+{% include copy-curl.html %}
- A [Well-Known Text](https://docs.opengeospatial.org/is/12-063r5/12-063r5.html) POINT in the "POINT(`longitude` `latitude`)" format
@@ -79,6 +84,7 @@ PUT testindex1/_doc/5
"point": "POINT (74.00 40.71)"
}
```
+{% include copy-curl.html %}
- GeoJSON format, where the `coordinates` are in the [`longitude`, `latitude`] format
@@ -91,6 +97,7 @@ PUT testindex1/_doc/6
}
}
```
+{% include copy-curl.html %}
## Parameters
diff --git a/_opensearch/supported-field-types/geo-shape.md b/_opensearch/supported-field-types/geo-shape.md
index 2da10ff3a5e..e66dfed8f8c 100644
--- a/_opensearch/supported-field-types/geo-shape.md
+++ b/_opensearch/supported-field-types/geo-shape.md
@@ -27,6 +27,7 @@ PUT testindex
}
}
```
+{% include copy-curl.html %}
## Formats
@@ -68,6 +69,7 @@ PUT testindex/_doc/1
}
}
```
+{% include copy-curl.html %}
Index a point in WKT format:
@@ -77,6 +79,7 @@ PUT testindex/_doc/1
"location" : "POINT (74.0060 40.7128)"
}
```
+{% include copy-curl.html %}
## Linestring
@@ -93,6 +96,7 @@ PUT testindex/_doc/2
}
}
```
+{% include copy-curl.html %}
Index a linestring in WKT format:
@@ -102,6 +106,7 @@ PUT testindex/_doc/2
"location" : "LINESTRING (74.0060 40.7128, 71.0589 42.3601)"
}
```
+{% include copy-curl.html %}
## Polygon
@@ -126,6 +131,7 @@ PUT testindex/_doc/3
}
}
```
+{% include copy-curl.html %}
Index a polygon (triangle) in WKT format:
@@ -135,6 +141,7 @@ PUT testindex/_doc/3
"location" : "POLYGON ((74.0060 40.7128, 71.0589 42.3601, 73.7562 42.6526, 74.0060 40.7128))"
}
```
+{% include copy-curl.html %}
The polygon may have holes inside. In this case, the `coordinates` field will contain multiple arrays. The first array represents the outer polygon, and each subsequent array represents a hole. Holes are represented as polygons and specified as arrays of coordinates.
@@ -162,6 +169,7 @@ PUT testindex/_doc/4
}
}
```
+{% include copy-curl.html %}
Index a polygon (triangle) with a triangular hole in WKT format:
@@ -171,6 +179,7 @@ PUT testindex/_doc/4
"location" : "POLYGON ((40.7128 74.0060, 42.3601 71.0589, 42.6526 73.7562, 40.7128 74.0060), (41.7658 72.6734, 41.5623 72.6506, 41.5582 73.0515, 41.7658 72.6734))"
}
```
+{% include copy-curl.html %}
In OpenSearch, you can specify a polygon by listing its vertices clockwise or counterclockwise. This works well for polygons that do not cross the date line (are narrower than 180°). However, a polygon that crosses the date line (is wider than 180°) might be ambiguous because WKT does not impose a specific order on vertices. Thus, you must specify polygons that cross the date line by listing their vertices counterclockwise.
@@ -189,6 +198,7 @@ PUT testindex
}
}
```
+{% include copy-curl.html %}
Subsequently indexed documents can override the `orientation` setting:
@@ -207,6 +217,7 @@ PUT testindex/_doc/3
}
}
```
+{% include copy-curl.html %}
## Multipoint
@@ -226,6 +237,7 @@ PUT testindex/_doc/6
}
}
```
+{% include copy-curl.html %}
Index a multipoint in WKT format:
@@ -235,6 +247,7 @@ PUT testindex/_doc/6
"location" : "MULTIPOINT (74.0060 40.7128, 71.0589 42.3601)"
}
```
+{% include copy-curl.html %}
## Multilinestring
@@ -254,6 +267,7 @@ PUT testindex/_doc/2
}
}
```
+{% include copy-curl.html %}
Index a linestring in WKT format:
@@ -263,6 +277,7 @@ PUT testindex/_doc/2
"location" : "MULTILINESTRING ((74.0060 40.7128, 71.0589 42.3601), (73.7562 42.6526, 72.6734 41.7658))"
}
```
+{% include copy-curl.html %}
## Multipolygon
@@ -297,6 +312,7 @@ PUT testindex/_doc/4
}
}
```
+{% include copy-curl.html %}
Index a multipolygon in WKT format:
@@ -306,8 +322,7 @@ PUT testindex/_doc/4
"location" : "MULTIPOLYGON (((40.7128 74.0060, 42.3601 71.0589, 42.6526 73.7562, 40.7128 74.0060), (41.7658 72.6734, 41.5623 72.6506, 41.5582 73.0515, 41.7658 72.6734)), ((73.9776 40.7614, 73.9554 40.7827, 73.9631 40.7812, 73.9776 40.7614)))"
}
```
-
-
+{% include copy-curl.html %}
## Geometry collection
@@ -333,6 +348,7 @@ PUT testindex/_doc/7
}
}
```
+{% include copy-curl.html %}
Index a geometry collection in WKT format:
@@ -342,6 +358,7 @@ PUT testindex/_doc/7
"location" : "GEOMETRYCOLLECTION (POINT (74.0060 40.7128), LINESTRING(73.7562 42.6526, 72.6734 41.7658))"
}
```
+{% include copy-curl.html %}
## Envelope
@@ -358,6 +375,7 @@ PUT testindex/_doc/2
}
}
```
+{% include copy-curl.html %}
In WKT format, use `BBOX (minLon, maxLon, maxLat, minLat)`.
@@ -369,6 +387,7 @@ PUT testindex/_doc/8
"location" : "BBOX (71.0589, 74.0060, 42.3601, 40.7128)"
}
```
+{% include copy-curl.html %}
## Parameters
diff --git a/_opensearch/supported-field-types/ip.md b/_opensearch/supported-field-types/ip.md
index 00ef322e843..250e2da6a0c 100644
--- a/_opensearch/supported-field-types/ip.md
+++ b/_opensearch/supported-field-types/ip.md
@@ -29,6 +29,7 @@ PUT testindex
}
}
```
+{% include copy-curl.html %}
Index a document with an IP address:
@@ -38,6 +39,7 @@ PUT testindex/_doc/1
"ip_address" : "10.24.34.0"
}
```
+{% include copy-curl.html %}
Query an index for a specific IP address:
@@ -51,6 +53,7 @@ GET testindex/_doc/1
}
}
```
+{% include copy-curl.html %}
## Searching for an IP address and its associated network mask
@@ -68,6 +71,7 @@ GET testindex/_search
}
}
```
+{% include copy-curl.html %}
#### Example query in IPv6 format
@@ -81,6 +85,7 @@ GET testindex/_search
}
}
```
+{% include copy-curl.html %}
If you use an IP address in IPv6 format in a `query_string` query, you need to escape `:` characters because they are parsed as special characters. You can accomplish this by wrapping the IP address in quotation marks and escaping those quotation marks with `\`.
@@ -94,6 +99,7 @@ GET testindex/_search
}
}
```
+{% include copy-curl.html %}
## Parameters
diff --git a/_opensearch/supported-field-types/join.md b/_opensearch/supported-field-types/join.md
index 173e29f0196..18a25637dbb 100644
--- a/_opensearch/supported-field-types/join.md
+++ b/_opensearch/supported-field-types/join.md
@@ -30,6 +30,7 @@ PUT testindex1
}
}
```
+{% include copy-curl.html %}
Then, index a parent document with a join field type:
@@ -42,6 +43,7 @@ PUT testindex1/_doc/1
}
}
```
+{% include copy-curl.html %}
You can also use a shortcut without object notation to index a parent document:
@@ -52,6 +54,7 @@ PUT testindex1/_doc/1
"product_to_brand" : "brand"
}
```
+{% include copy-curl.html %}
When indexing child documents, you have to specify the `routing` query parameter because parent and child documents in the same relation have to be indexed on the same shard. Each child document refers to its parent's ID in the `parent` field.
@@ -66,7 +69,10 @@ PUT testindex1/_doc/3?routing=1
"parent": "1"
}
}
+```
+{% include copy-curl.html %}
+```json
PUT testindex1/_doc/4?routing=1
{
"name": "Product 2",
@@ -76,6 +82,7 @@ PUT testindex1/_doc/4?routing=1
}
}
```
+{% include copy-curl.html %}
## Querying a join field
@@ -91,6 +98,7 @@ GET testindex1/_search
}
}
```
+{% include copy-curl.html %}
The response indicates whether a document is a parent or a child:
@@ -175,6 +183,7 @@ GET testindex1/_search
}
}
```
+{% include copy-curl.html %}
The response contains Product 1 and Product 2, which are associated with Brand 1:
@@ -247,6 +256,7 @@ GET testindex1/_search
}
}
```
+{% include copy-curl.html %}
The response returns Brand 1 as Product 1's parent:
@@ -303,6 +313,7 @@ PUT testindex1
}
}
```
+{% include copy-curl.html %}
## Join field type notes
diff --git a/_opensearch/supported-field-types/keyword.md b/_opensearch/supported-field-types/keyword.md
index 8374b3501ca..cfa522f5993 100644
--- a/_opensearch/supported-field-types/keyword.md
+++ b/_opensearch/supported-field-types/keyword.md
@@ -30,6 +30,7 @@ PUT movies
}
}
```
+{% include copy-curl.html %}
## Parameters
diff --git a/_opensearch/supported-field-types/nested.md b/_opensearch/supported-field-types/nested.md
index 84f29e61c2d..bb27cd28ee8 100644
--- a/_opensearch/supported-field-types/nested.md
+++ b/_opensearch/supported-field-types/nested.md
@@ -26,6 +26,7 @@ PUT testindex1/_doc/100
]
}
```
+{% include copy-curl.html %}
When these objects are stored, they are flattened, so their internal representation has an array of all values for each field:
@@ -62,6 +63,7 @@ GET testindex1/_search
}
}
```
+{% include copy-curl.html %}
The query correctly returns document 100:
@@ -132,6 +134,7 @@ GET testindex1/_search
}
}
```
+{% include copy-curl.html %}
However, this query still incorrectly returns document 100. This is because the relation between age and smoking was lost when arrays of values for individual fields were created.
@@ -151,6 +154,7 @@ PUT testindex1
}
}
```
+{% include copy-curl.html %}
Then, index a document with a nested field type:
@@ -163,6 +167,7 @@ PUT testindex1/_doc/100
]
}
```
+{% include copy-curl.html %}
Now if you run the same query to search for patients older than 75 AND smokers, nothing is returned, which is correct.
diff --git a/_opensearch/supported-field-types/numeric.md b/_opensearch/supported-field-types/numeric.md
index 882d68dfabc..c12326e1723 100644
--- a/_opensearch/supported-field-types/numeric.md
+++ b/_opensearch/supported-field-types/numeric.md
@@ -45,6 +45,7 @@ PUT testindex
}
}
```
+{% include copy-curl.html %}
Index a document with an integer value:
@@ -54,6 +55,7 @@ PUT testindex/_doc/1
"integer_value" : 123
}
```
+{% include copy-curl.html %}
## Scaled float field type
@@ -79,6 +81,7 @@ PUT testindex
}
}
```
+{% include copy-curl.html %}
Index a document with a scaled_float value:
@@ -88,6 +91,7 @@ PUT testindex/_doc/1
"scaled" : 2.3
}
```
+{% include copy-curl.html %}
The `scaled` value will be stored as 23.
diff --git a/_opensearch/supported-field-types/object.md b/_opensearch/supported-field-types/object.md
index e4283d3e25b..68cb15cb83c 100644
--- a/_opensearch/supported-field-types/object.md
+++ b/_opensearch/supported-field-types/object.md
@@ -33,6 +33,7 @@ PUT testindex1/_mappings
}
}
```
+{% include copy-curl.html %}
Index a document with an object field:
@@ -45,6 +46,7 @@ PUT testindex1/_doc/1
}
}
```
+{% include copy-curl.html %}
Nested objects are stored as flat key/value pairs internally. To refer to a field in a nested object, use `parent field`.`child field` (for example, `patient.id`).
@@ -60,6 +62,7 @@ GET testindex1/_search
}
}
```
+{% include copy-curl.html %}
## Parameters
@@ -92,6 +95,7 @@ PUT testindex1/_mappings
}
}
```
+{% include copy-curl.html %}
Then you index a document with a new `id` field in `patient`:
@@ -104,6 +108,7 @@ PUT testindex1/_doc/1
}
}
```
+{% include copy-curl.html %}
As a result, the field `id` is added to the mappings:
diff --git a/_opensearch/supported-field-types/percolator.md b/_opensearch/supported-field-types/percolator.md
index 0dc498b0df1..393c9e0aaa9 100644
--- a/_opensearch/supported-field-types/percolator.md
+++ b/_opensearch/supported-field-types/percolator.md
@@ -38,6 +38,7 @@ PUT testindex1
}
}
```
+{% include copy-curl.html %}
Index a query:
@@ -68,6 +69,7 @@ PUT testindex1/_doc/1
}
}
```
+{% include copy-curl.html %}
Fields referenced in the query must already exist in the mapping.
{: .note }
@@ -93,6 +95,7 @@ GET testindex1/_search
}
}
```
+{% include copy-curl.html %}
The response contains the originally indexed query:
diff --git a/_opensearch/supported-field-types/range.md b/_opensearch/supported-field-types/range.md
index 83ba1f04adc..218b4f88002 100644
--- a/_opensearch/supported-field-types/range.md
+++ b/_opensearch/supported-field-types/range.md
@@ -39,6 +39,7 @@ PUT testindex
}
}
```
+{% include copy-curl.html %}
Index a document with a double range and a date range:
@@ -55,6 +56,7 @@ PUT testindex/_doc/1
}
}
```
+{% include copy-curl.html %}
You can use a [Term query](#term-query) or a [Range query](#range-query) to search for values within range fields.
@@ -76,6 +78,7 @@ GET testindex/_search
}
}
```
+{% include copy-curl.html %}
### Range query
@@ -108,6 +111,7 @@ GET testindex1/_search
}
}
```
+{% include copy-curl.html %}
The above query will return document 1 for the `within` and `intersects` relations but will not return it for the `contains` relation.
@@ -132,6 +136,7 @@ PUT testindex
}
}
```
+{% include copy-curl.html %}
Index a document with IP address ranges in both formats:
@@ -145,6 +150,7 @@ PUT testindex/_doc/2
"ip_address_cidr" : "10.24.34.0/24"
}
```
+{% include copy-curl.html %}
## Parameters
diff --git a/_opensearch/supported-field-types/rank.md b/_opensearch/supported-field-types/rank.md
index eaa8728e9d1..50aab1bc64b 100644
--- a/_opensearch/supported-field-types/rank.md
+++ b/_opensearch/supported-field-types/rank.md
@@ -45,6 +45,7 @@ PUT chessplayers
}
}
```
+{% include copy-curl.html %}
Index three documents with a rank_feature field that boosts the score (`rating`) and a rank_feature field that decreases the score (`age`):
@@ -55,14 +56,20 @@ PUT testindex1/_doc/1
"rating" : 2554,
"age" : 75
}
+```
+{% include copy-curl.html %}
+```json
PUT testindex1/_doc/2
{
"name" : "Kwaku Mensah",
"rating" : 2067,
"age": 10
}
+```
+{% include copy-curl.html %}
+```json
PUT testindex1/_doc/3
{
"name" : "Nikki Wolf",
@@ -70,6 +77,7 @@ PUT testindex1/_doc/3
"age" : 22
}
```
+{% include copy-curl.html %}
## Rank feature query
@@ -98,6 +106,7 @@ GET chessplayers/_search
}
}
```
+{% include copy-curl.html %}
When ranked by both age and rating, younger players and players who are more highly ranked score better:
@@ -176,6 +185,7 @@ PUT testindex1
}
}
```
+{% include copy-curl.html %}
To index a document with a rank features field, use a hashmap with string keys and positive float values:
@@ -188,7 +198,10 @@ PUT testindex1/_doc/1
"teens" : 25.9
}
}
+```
+{% include copy-curl.html %}
+```json
PUT testindex1/_doc/2
{
"correlations": {
@@ -197,6 +210,7 @@ PUT testindex1/_doc/2
}
}
```
+{% include copy-curl.html %}
Query the documents using a rank feature query:
@@ -210,6 +224,7 @@ GET testindex1/_search
}
}
```
+{% include copy-curl.html %}
The response is ranked by relevance score:
diff --git a/_opensearch/supported-field-types/search-as-you-type.md b/_opensearch/supported-field-types/search-as-you-type.md
index 17bd0915025..eb4d863ef02 100644
--- a/_opensearch/supported-field-types/search-as-you-type.md
+++ b/_opensearch/supported-field-types/search-as-you-type.md
@@ -29,6 +29,7 @@ PUT books
}
}
```
+{% include copy-curl.html %}
In addition to the `suggestions` field, this creates `suggestions._2gram`, `suggestions._3gram`, and `suggestions._index_prefix` fields.
@@ -40,6 +41,7 @@ PUT books/_doc/1
"suggestions": "one two three four"
}
```
+{% include copy-curl.html %}
To match terms in any order, use a bool_prefix or multi-match query. These queries rank the documents in which search terms are in the specified order higher than the documents in which terms are out of order.
@@ -59,6 +61,7 @@ GET books/_search
}
}
```
+{% include copy-curl.html %}
The response contains the matching document:
@@ -105,6 +108,7 @@ GET books/_search
}
}
```
+{% include copy-curl.html %}
The response contains the matching document:
@@ -151,6 +155,7 @@ GET books/_search
}
}
```
+{% include copy-curl.html %}
Response:
diff --git a/_opensearch/supported-field-types/text.md b/_opensearch/supported-field-types/text.md
index f2db314ac5e..37f3a6c07b0 100644
--- a/_opensearch/supported-field-types/text.md
+++ b/_opensearch/supported-field-types/text.md
@@ -31,6 +31,7 @@ PUT movies
}
}
```
+{% include copy-curl.html %}
## Parameters
@@ -94,6 +95,7 @@ PUT testindex
}
}
```
+{% include copy-curl.html %}
Index a document with a text field:
@@ -103,6 +105,7 @@ PUT testindex/_doc/1
"dob" : "The patient's date of birth."
}
```
+{% include copy-curl.html %}
Query for "date of birth" and highlight it in the original field:
@@ -121,6 +124,7 @@ GET testindex/_search
}
}
```
+{% include copy-curl.html %}
The words "date of birth" are highlighted in the response:
diff --git a/_opensearch/supported-field-types/token-count.md b/_opensearch/supported-field-types/token-count.md
index 06e437cda09..c1795af3a46 100644
--- a/_opensearch/supported-field-types/token-count.md
+++ b/_opensearch/supported-field-types/token-count.md
@@ -33,19 +33,27 @@ PUT testindex
}
}
```
+{% include copy-curl.html %}
Index three documents with text fields:
```json
PUT testindex/_doc/1
{ "sentence": "To be, or not to be: that is the question." }
+```
+{% include copy-curl.html %}
+```json
PUT testindex/_doc/2
{ "sentence": "All the world’s a stage, and all the men and women are merely players." }
+```
+{% include copy-curl.html %}
+```json
PUT testindex/_doc/3
{ "sentence": "Now is the winter of our discontent." }
```
+{% include copy-curl.html %}
Search for sentences with fewer than 10 words:
@@ -61,6 +69,7 @@ GET testindex/_search
}
}
```
+{% include copy-curl.html %}
The response contains one matching sentence:
diff --git a/_opensearch/supported-field-types/xy-point.md b/_opensearch/supported-field-types/xy-point.md
index bcafa2c31f9..8909c43bc28 100644
--- a/_opensearch/supported-field-types/xy-point.md
+++ b/_opensearch/supported-field-types/xy-point.md
@@ -27,6 +27,7 @@ PUT testindex1
}
}
```
+{% include copy-curl.html %}
## Formats
@@ -43,6 +44,7 @@ PUT testindex1/_doc/1
}
}
```
+{% include copy-curl.html %}
- A string in the "`x`, `y`" format
@@ -52,6 +54,7 @@ PUT testindex1/_doc/2
"point": "0.5, 4.5"
}
```
+{% include copy-curl.html %}
- An array in the [`x`, `y`] format
@@ -61,6 +64,7 @@ PUT testindex1/_doc/3
"point": [0.5, 4.5]
}
```
+{% include copy-curl.html %}
- A [well-known text (WKT)](https://docs.opengeospatial.org/is/12-063r5/12-063r5.html) POINT in the "POINT(`x` `y`)" format
@@ -70,6 +74,7 @@ PUT testindex1/_doc/4
"point": "POINT (0.5 4.5)"
}
```
+{% include copy-curl.html %}
- GeoJSON format
@@ -82,6 +87,7 @@ PUT testindex1/_doc/5
}
}
```
+{% include copy-curl.html %}
In all xy point formats, the coordinates must be specified in the `x, y` order.
{: .note}
diff --git a/_opensearch/supported-field-types/xy-shape.md b/_opensearch/supported-field-types/xy-shape.md
index dfb4ba09607..07cc85866b2 100644
--- a/_opensearch/supported-field-types/xy-shape.md
+++ b/_opensearch/supported-field-types/xy-shape.md
@@ -29,6 +29,7 @@ PUT testindex
}
}
```
+{% include copy-curl.html %}
## Formats
@@ -70,6 +71,7 @@ PUT testindex/_doc/1
}
}
```
+{% include copy-curl.html %}
Index a point in WKT format:
@@ -79,6 +81,7 @@ PUT testindex/_doc/1
"location" : "POINT (0.5 4.5)"
}
```
+{% include copy-curl.html %}
## Linestring
@@ -95,6 +98,7 @@ PUT testindex/_doc/2
}
}
```
+{% include copy-curl.html %}
Index a linestring in WKT format:
@@ -104,6 +108,7 @@ PUT testindex/_doc/2
"location" : "LINESTRING (0.5 4.5, -1.5 2.3)"
}
```
+{% include copy-curl.html %}
## Polygon
@@ -128,6 +133,7 @@ PUT testindex/_doc/3
}
}
```
+{% include copy-curl.html %}
Index a polygon (triangle) in WKT format:
@@ -137,6 +143,7 @@ PUT testindex/_doc/3
"location" : "POLYGON ((0.5 4.5, 2.5 6.0, 1.5 2.0, 0.5 4.5))"
}
```
+{% include copy-curl.html %}
The polygon may have holes inside. In this case, the `coordinates` field will contain multiple arrays. The first array represents the outer polygon, and each subsequent array represents a hole. Holes are represented as polygons and specified as arrays of coordinates.
@@ -164,6 +171,7 @@ PUT testindex/_doc/4
}
}
```
+{% include copy-curl.html %}
Index a polygon (triangle) with a triangular hole in WKT format:
@@ -173,6 +181,8 @@ PUT testindex/_doc/4
"location" : "POLYGON ((0.5 4.5, 2.5 6.0, 1.5 2.0, 0.5 4.5), (1.0 4.5, 1.5 4.5, 1.5 4.0, 1.0 4.5))"
}
```
+{% include copy-curl.html %}
+
By default, the vertices of the polygon are traversed in a counterclockwise order. You can define an [`orientation`](#parameters) parameter to specify the vertex traversal order at mapping time:
```json
@@ -188,6 +198,7 @@ PUT testindex
}
}
```
+{% include copy-curl.html %}
Subsequently indexed documents can override the `orientation` setting:
@@ -206,6 +217,7 @@ PUT testindex/_doc/3
}
}
```
+{% include copy-curl.html %}
## Multipoint
@@ -225,6 +237,7 @@ PUT testindex/_doc/6
}
}
```
+{% include copy-curl.html %}
Index a multipoint in WKT format:
@@ -234,6 +247,7 @@ PUT testindex/_doc/6
"location" : "MULTIPOINT (0.5 4.5, 2.5 6.0)"
}
```
+{% include copy-curl.html %}
## Multilinestring
@@ -253,6 +267,7 @@ PUT testindex/_doc/2
}
}
```
+{% include copy-curl.html %}
Index a linestring in WKT format:
@@ -262,6 +277,7 @@ PUT testindex/_doc/2
"location" : "MULTILINESTRING ((0.5 4.5, 2.5 6.0), (1.5 2.0, 3.5 3.5))"
}
```
+{% include copy-curl.html %}
## Multipolygon
@@ -296,6 +312,7 @@ PUT testindex/_doc/4
}
}
```
+{% include copy-curl.html %}
Index a multipolygon in WKT format:
@@ -305,6 +322,7 @@ PUT testindex/_doc/4
"location" : "MULTIPOLYGON (((0.5 4.5, 2.5 6.0, 1.5 2.0, 0.5 4.5), (1.0 4.5, 1.5 4.5, 1.5 4.0, 1.0 4.5)), ((2.0 0.0, 1.0 2.0, 3.0 1.0, 2.0 0.0)))"
}
```
+{% include copy-curl.html %}
## Geometry collection
@@ -330,6 +348,7 @@ PUT testindex/_doc/7
}
}
```
+{% include copy-curl.html %}
Index a geometry collection in WKT format:
@@ -339,6 +358,7 @@ PUT testindex/_doc/7
"location" : "GEOMETRYCOLLECTION (POINT (0.5 4.5), LINESTRING(2.5 6.0, 1.5 2.0))"
}
```
+{% include copy-curl.html %}
## Envelope
@@ -355,6 +375,7 @@ PUT testindex/_doc/2
}
}
```
+{% include copy-curl.html %}
In WKT format, use `BBOX (minX, maxY, maxX, minY)`.
@@ -366,6 +387,7 @@ PUT testindex/_doc/8
"location" : "BBOX (3.0, 2.0, 6.0, 0.0)"
}
```
+{% include copy-curl.html %}
## Parameters