Skip to content

Commit 2b6a0e7

Browse files
authored
Improve descriptions for mget API
1 parent c67efb6 commit 2b6a0e7

File tree

3 files changed

+87
-17
lines changed

3 files changed

+87
-17
lines changed

output/schema/schema.json

Lines changed: 28 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

specification/_global/mget/MultiGetRequest.ts

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,62 @@ import { SourceConfigParam } from '@global/search/_types/SourceFilter'
3030
*/
3131
export interface Request extends RequestBase {
3232
path_parts: {
33+
/**
34+
* Name of the index to retrieve documents from when `ids` are specified, or when a document in the `docs` array does not specify an index.
35+
*/
3336
index?: IndexName
3437
}
3538
query_parameters: {
39+
/**
40+
* Specifies the node or shard the operation should be performed on. Random by default.
41+
*/
3642
preference?: string
37-
realtime?: boolean // default: true
38-
refresh?: boolean // default: false
43+
/**
44+
* If `true`, the request is real-time as opposed to near-real-time.
45+
* @server_default true
46+
* @doc_url https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html#realtime
47+
*/
48+
realtime?: boolean
49+
/**
50+
* If `true`, the request refreshes relevant shards before retrieving documents.
51+
* @server_default false
52+
*/
53+
refresh?: boolean
54+
/**
55+
* Custom value used to route operations to a specific shard.
56+
*/
3957
routing?: Routing
58+
/**
59+
* True or false to return the `_source` field or not, or a list of fields to return.
60+
*/
4061
_source?: SourceConfigParam
62+
/**
63+
* A comma-separated list of source fields to exclude from the response.
64+
* You can also use this parameter to exclude fields from the subset specified in `_source_includes` query parameter.
65+
* @doc_url https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-source-field.html
66+
*/
4167
_source_excludes?: Fields
68+
/**
69+
* A comma-separated list of source fields to include in the response.
70+
* If this parameter is specified, only these source fields are returned. You can exclude fields from this subset using the `_source_excludes` query parameter.
71+
* If the `_source` parameter is `false`, this parameter is ignored.
72+
* @doc_url https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-source-field.html
73+
*/
4274
_source_includes?: Fields
75+
/**
76+
* If `true`, retrieves the document fields stored in the index rather than the document `_source`.
77+
* @server_default false
78+
*/
4379
stored_fields?: Fields
4480
}
4581
body: {
82+
/**
83+
* The documents you want to retrieve. Required if no index is specified in the request URI.
84+
*/
4685
docs?: Operation[]
86+
/**
87+
* The IDs of the documents you want to retrieve. Allowed when the index is specified in the request URI.
88+
*/
4789
ids?: Ids
4890
}
4991
}

specification/_global/mget/types.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,25 @@ import { ErrorCause } from '@_types/Errors'
3030
import { GetResult } from '@global/get/types'
3131

3232
export class Operation {
33+
/**
34+
* The unique document ID.
35+
*/
3336
_id: Id
37+
/**
38+
* The index that contains the document.
39+
*/
3440
_index?: IndexName
41+
/**
42+
* The key for the primary shard the document resides on. Required if routing is used during indexing.
43+
*/
3544
routing?: Routing
45+
/**
46+
* If `false`, excludes all _source fields.
47+
*/
3648
_source?: SourceConfig
49+
/**
50+
* The stored fields you want to retrieve.
51+
*/
3752
stored_fields?: Fields
3853
version?: VersionNumber
3954
version_type?: VersionType

0 commit comments

Comments
 (0)