mirror of
https://github.com/iSharkFly-Docs/opensearch-docs-cn
synced 2025-03-09 14:38:01 +00:00
* Make API reference top level Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Fix typo on Drag and Drop page (#1633) * Fix typo on Drag and Drop page * Update _dashboards/drag-drop-wizard.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update drag-drop-wizard.md Co-authored-by: Nate Bower <nbower@amazon.com> * Putting all the Docker install material on a single page (#1452) * Putting all the Docker install material on a single page Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Making room for revamp Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Intro added Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Continuing to flesh out the intro section and overview Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Overview finalized Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Introducing docker compose Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Added link to compose Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Continuing docker image commentary Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Sometimes I wonder if anyone reads these Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Adding notes on installing compose with pip Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Adding prereqs Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Magnets - how do they work? Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Almonds and peaches are part of the same plant subgenus, Amygdalus Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * There are 293 ways to make change for a dollar Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * A shark is the only known fish that can blink with both eyes Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * A crocodile cannot stick its tongue out Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * wording Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Reorganizing a couple paragraphs to make it flow better Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Forgot a word Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Add tip about pruning stopped containers Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Cleaning up Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Add blurb about container ls Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Adding the Docker Compose stuff Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Working on compose Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Continuing work on the compose section - it's a lot of info Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Added important settings Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Updates to settings that need configured Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Still working through compose things Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Fixed wording Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Working through compose commands and guidance Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Reordering/rewording Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * More phrasing Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * More wording in steps Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * More wording in steps Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Organizing Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Adding stuff and things Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Continuing to work through the configuration steps Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Fixes Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Fixes Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Still working on the configuration steps Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Changes Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * More work Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Removed perf analyzer - refer to GH issue 1555 Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Fixing things Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Adding guidance on passing settings in compose Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Working through dockerfile materials now Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * wording Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Finalized the sample dev compose file Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Continuing work with configuration Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Finished - ready for reviews Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Fixed a link I forgot to change before Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Changes from first proofread Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Changed heading Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Addressed reviewer comments and made some changes Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Forgot to incorporate one change. Fixed. Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Final editorial changes Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * fix#1584-custom_attr_allowlist (#1636) Signed-off-by: cwillum <cwmmoore@amazon.com> Signed-off-by: cwillum <cwmmoore@amazon.com> * Update TERMS.md with definition for Setting (#1632) * fix#1631-Terms-setting Signed-off-by: cwillum <cwmmoore@amazon.com> * fix#1631-Terms-setting Signed-off-by: cwillum <cwmmoore@amazon.com> Signed-off-by: cwillum <cwmmoore@amazon.com> * Add disclaimer about remote fs usage and an example of setting env var (#1644) * Add disclaimer about remote fs usage and an example of setting env var Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * Enhanced wording a little bit Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> * [DOC] New documentation: Self-host maps server (#1625) * Add new page self-host maps server Signed-off-by: vagimeli <vagimeli@amazon.com> * Added new content Signed-off-by: vagimeli <vagimeli@amazon.com> * Copy edit Signed-off-by: vagimeli <vagimeli@amazon.com> * Tech review edits Signed-off-by: vagimeli <vagimeli@amazon.com> * Doc review edits Signed-off-by: vagimeli <vagimeli@amazon.com> * Editorial review changes Signed-off-by: vagimeli <vagimeli@amazon.com> * Final edits Signed-off-by: vagimeli <vagimeli@amazon.com> Signed-off-by: vagimeli <vagimeli@amazon.com> * Add feedback. Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Fix links Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Signed-off-by: JeffH-AWS <jeffhuss@amazon.com> Signed-off-by: cwillum <cwmmoore@amazon.com> Signed-off-by: vagimeli <vagimeli@amazon.com> Co-authored-by: Nate Bower <nbower@amazon.com> Co-authored-by: Jeff Huss <jeffhuss@amazon.com> Co-authored-by: Chris Moore <107723039+cwillum@users.noreply.github.com> Co-authored-by: Melissa Vagi <105296784+vagimeli@users.noreply.github.com>
4.9 KiB
4.9 KiB
layout | title | parent | nav_order |
---|---|---|---|
default | Multi-get document | Document APIs | 30 |
Multi-get documents
Introduced 1.0 {: .label .label-purple }
The multi-get operation allows you to execute multiple GET operations in one request, so you can get back all documents that match your criteria.
Example without specifying index in URL
GET _mget
{
"docs": [
{
"_index": "sample-index1",
"_id": "1"
},
{
"_index": "sample-index2",
"_id": "1",
"_source": {
"include": ["Length"]
}
}
]
}
Example of specifying index in URL
GET sample-index1/_mget
{
"docs": [
{
"_id": "1",
"_source": false
},
{
"_id": "2",
"_source": [ "Director", "Title" ]
}
]
}
Path and HTTP methods
GET _mget
GET <index>/_mget
URL parameters
All multi-get URL parameters are optional.
Parameter | Type | Description | |
---|---|---|---|
<index> | String | Name of the index to retrieve documents from. | |
preference | String | Specifies the nodes or shards OpenSearch should execute the multi-get operation on. Default is random. | |
realtime | Boolean | Specifies whether the operation should run in realtime. If false, the operation waits for the index to refresh to analyze the source to retrieve data, which makes the operation near-realtime. Default is true . |
|
refresh | Boolean | If true, OpenSearch refreshes shards to make the multi-get operation available to search results. Valid options are true , false , and wait_for , which tells OpenSearch to wait for a refresh before executing the operation. Default is false . |
|
routing | String | Value used to route the multi-get operation to a specific shard. | |
stored_fields | Boolean | Specifies whether OpenSearch should retrieve documents fields from the index instead of the document's _source . Default is false . |
|
_source | String | Whether to include the _source field in the query response. Default is true . |
|
_source_excludes | String | A comma-separated list of source fields to exclude in the query response. | |
_source_includes | String | A comma-separated list of source fields to include in the query response. |
Request body
If you don't specify an index in your request's URL, you must specify your target indices and the relevant document IDs in the request body. Other fields are optional.
Field | Type | Description | Required |
---|---|---|---|
docs | Array | The documents you want to retrieve data from. Can contain the attributes: _id , _index , _routing , _source , and _stored_fields . If you specify an index in the URL, you can omit this field and add IDs of the documents to retrieve. |
Yes if an index is not specified in the URL |
_id | String | The ID of the document. | Yes if docs is specified in the request body |
_index | String | Name of the index. | Yes if an index is not specified in the URL |
_routing | String | The value of the shard that has the document. | Yes if a routing value was used when indexing the document |
_source | Object | Specifies whether to return the _source field from an index (boolean), whether to return specific fields (array), or whether to include or exclude certain fields. |
No |
_source.includes | Array | Specifies which fields to include in the query response. For example, "_source": { "include": ["Title"] } retrieves Title from the index. |
No |
_source.excludes | Array | Specifies which fields to exclude in the query response. For example, "_source": { "exclude": ["Director"] } excludes Director from the query response. |
No |
ids | Array | IDs of the documents to retrieve. Only allowed when an index is specified in the URL. | No |
Response
{
"docs": [
{
"_index": "sample-index1",
"_id": "1",
"_version": 4,
"_seq_no": 5,
"_primary_term": 19,
"found": true,
"_source": {
"Title": "Batman Begins",
"Director": "Christopher Nolan"
}
},
{
"_index": "sample-index2",
"_id": "1",
"_version": 1,
"_seq_no": 6,
"_primary_term": 19,
"found": true,
"_source": {
"Title": "The Dark Knight",
"Director": "Christopher Nolan"
}
}
]
}
Response body fields
Field | Description |
---|---|
_index | The name of the index. |
_id | The document's ID. |
_version | The document's version number. Updated whenever the document changes. |
_seq_no | The sequnce number assigned when the document is indexed. |
primary_term | The primary term assigned when the document is indexed. |
found | Whether the document exists. |
_routing | The shard that the document is routed to. If the document is not routed to a particular shard, this field is omitted. |
_source | Contains the document's data if found is true. If _source is set to false or stored_fields is set to true in the URL parameters, this field is omitted. |
_fields | Contains the document's data that's stored in the index. Only returned if both stored_fields and found are true. |