Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion docs/reference/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -1683,7 +1683,7 @@ client.search({ ... })
- **`include_named_queries_score` (Optional, boolean)**: If `true`, the response includes the score contribution from any named queries. This functionality reruns each named query on every hit in a search response. Typically, this adds a small overhead to a request. However, using computationally expensive named queries on a large number of hits may add significant overhead.
- **`lenient` (Optional, boolean)**: If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored. This parameter can be used only when the `q` query string parameter is specified.
- **`max_concurrent_shard_requests` (Optional, number)**: The number of concurrent shard requests per node that the search runs concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests.
- **`preference` (Optional, string)**: The nodes and shards used for the search. By default, Elasticsearch selects from eligible nodes and shards using adaptive replica selection, accounting for allocation awareness. Valid values are: * `_only_local` to run the search only on shards on the local node. * `_local` to, if possible, run the search on shards on the local node, or if not, select shards using the default method. * `_only_nodes:<node-id>,<node-id>` to run the search on only the specified nodes IDs. If suitable shards exist on more than one selected node, use shards on those nodes using the default method. If none of the specified nodes are available, select shards from any available node using the default method. * `_prefer_nodes:<node-id>,<node-id>` to if possible, run the search on the specified nodes IDs. If not, select shards using the default method. `_shards:<shard>,<shard>` to run the search only on the specified shards. You can combine this value with other `preference` values. However, the `_shards` value must come first. For example: `_shards:2,3|_local`. `<custom-string>` (any string that does not start with `_`) to route searches with the same `<custom-string>` to the same shards in the same order.
- **`preference` (Optional, string)**: The nodes and shards used for the search. By default, Elasticsearch selects from eligible nodes and shards using adaptive replica selection, accounting for allocation awareness. Valid values are: * `_only_local` to run the search only on shards on the local node. * `_local` to, if possible, run the search on shards on the local node, or if not, select shards using the default method. * `_only_nodes:<node-id>,<node-id>` to run the search on only the specified nodes IDs. If suitable shards exist on more than one selected node, use shards on those nodes using the default method. If none of the specified nodes are available, select shards from any available node using the default method. * `_prefer_nodes:<node-id>,<node-id>` to if possible, run the search on the specified nodes IDs. If not, select shards using the default method. * `_shards:<shard>,<shard>` to run the search only on the specified shards. You can combine this value with other `preference` values. However, the `_shards` value must come first. For example: `_shards:2,3|_local`. * `<custom-string>` (any string that does not start with `_`) to route searches with the same `<custom-string>` to the same shards in the same order.
- **`pre_filter_shard_size` (Optional, number)**: A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method (if date filters are mandatory to match but the shard bounds and the query are disjoint). When unspecified, the pre-filter phase is executed if any of these conditions is met: * The request targets more than 128 shards. * The request targets one or more read-only index. * The primary sort of the query targets an indexed field.
- **`request_cache` (Optional, boolean)**: If `true`, the caching of search results is enabled for requests where `size` is `0`. It defaults to index level settings.
- **`routing` (Optional, string)**: A custom value that is used to route operations to a specific shard.
Expand Down Expand Up @@ -5614,6 +5614,15 @@ client.indices.create({ index })

#### Request (object) [_request_indices.create]
- **`index` (string)**: Name of the index you wish to create.
Index names must meet the following criteria:

* Lowercase only
* Cannot include `\`, `/`, `*`, `?`, `"`, `<`, `>`, `|`, ` ` (space character), `,`, or `#`
* Indices prior to 7.0 could contain a colon (`:`), but that has been deprecated and will not be supported in later versions
* Cannot start with `-`, `_`, or `+`
* Cannot be `.` or `..`
* Cannot be longer than 255 bytes (note thtat it is bytes, so multi-byte characters will reach the limit faster)
* Names starting with `.` are deprecated, except for hidden indices and internal indices managed by plugins
- **`aliases` (Optional, Record<string, { filter, index_routing, is_hidden, is_write_index, routing, search_routing }>)**: Aliases for the index.
- **`mappings` (Optional, { all_field, date_detection, dynamic, dynamic_date_formats, dynamic_templates, _field_names, index_field, _meta, numeric_detection, properties, _routing, _size, _source, runtime, enabled, subobjects, _data_stream_timestamp })**: Mapping for fields in the index. If specified, this mapping can include:
- Field names
Expand Down
118 changes: 110 additions & 8 deletions src/api/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2036,8 +2036,8 @@ export interface SearchRequest extends RequestBase {
* * `_local` to, if possible, run the search on shards on the local node, or if not, select shards using the default method.
* * `_only_nodes:<node-id>,<node-id>` to run the search on only the specified nodes IDs. If suitable shards exist on more than one selected node, use shards on those nodes using the default method. If none of the specified nodes are available, select shards from any available node using the default method.
* * `_prefer_nodes:<node-id>,<node-id>` to if possible, run the search on the specified nodes IDs. If not, select shards using the default method.
* `_shards:<shard>,<shard>` to run the search only on the specified shards. You can combine this value with other `preference` values. However, the `_shards` value must come first. For example: `_shards:2,3|_local`.
* `<custom-string>` (any string that does not start with `_`) to route searches with the same `<custom-string>` to the same shards in the same order. */
* * `_shards:<shard>,<shard>` to run the search only on the specified shards. You can combine this value with other `preference` values. However, the `_shards` value must come first. For example: `_shards:2,3|_local`.
* * `<custom-string>` (any string that does not start with `_`) to route searches with the same `<custom-string>` to the same shards in the same order. */
preference?: string
/** A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold.
* This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method (if date filters are mandatory to match but the shard bounds and the query are disjoint).
Expand Down Expand Up @@ -2613,7 +2613,7 @@ export interface SearchInnerHits {
ignore_unmapped?: boolean
script_fields?: Record<Field, ScriptField>
seq_no_primary_term?: boolean
fields?: Fields
fields?: Field[]
/** How the inner hits should be sorted per `inner_hits`.
* By default, inner hits are sorted by score. */
sort?: Sort
Expand Down Expand Up @@ -15828,6 +15828,62 @@ export interface ClusterStateRequest extends RequestBase {

export type ClusterStateResponse = any

export interface ClusterStatsCCSStats {
/** Contains remote cluster settings and metrics collected from them.
* The keys are cluster names, and the values are per-cluster data.
* Only present if `include_remotes` option is set to true. */
clusters?: Record<string, ClusterStatsRemoteClusterInfo>
/** Information about cross-cluster search usage. */
_search: ClusterStatsCCSUsageStats
/** Information about ES|QL cross-cluster query usage. */
_esql?: ClusterStatsCCSUsageStats
}

export interface ClusterStatsCCSUsageClusterStats {
/** The total number of successful (not skipped) cross-cluster search requests that were executed against this cluster. This may include requests where partial results were returned, but not requests in which the cluster has been skipped entirely. */
total: integer
/** The total number of cross-cluster search requests for which this cluster was skipped. */
skipped: integer
/** Statistics about the time taken to execute requests against this cluster. */
took: ClusterStatsCCSUsageTimeValue
}

export interface ClusterStatsCCSUsageStats {
/** The total number of cross-cluster search requests that have been executed by the cluster. */
total: integer
/** The total number of cross-cluster search requests that have been successfully executed by the cluster. */
success: integer
/** The total number of cross-cluster search requests (successful or failed) that had at least one remote cluster skipped. */
skipped: integer
/** Statistics about the time taken to execute cross-cluster search requests. */
took: ClusterStatsCCSUsageTimeValue
/** Statistics about the time taken to execute cross-cluster search requests for which the `ccs_minimize_roundtrips` setting was set to `true`. */
took_mrt_true?: ClusterStatsCCSUsageTimeValue
/** Statistics about the time taken to execute cross-cluster search requests for which the `ccs_minimize_roundtrips` setting was set to `false`. */
took_mrt_false?: ClusterStatsCCSUsageTimeValue
/** The maximum number of remote clusters that were queried in a single cross-cluster search request. */
remotes_per_search_max: integer
/** The average number of remote clusters that were queried in a single cross-cluster search request. */
remotes_per_search_avg: double
/** Statistics about the reasons for cross-cluster search request failures. The keys are the failure reason names and the values are the number of requests that failed for that reason. */
failure_reasons: Record<string, integer>
/** The keys are the names of the search feature, and the values are the number of requests that used that feature. Single request can use more than one feature (e.g. both `async` and `wildcard`). */
features: Record<string, integer>
/** Statistics about the clients that executed cross-cluster search requests. The keys are the names of the clients, and the values are the number of requests that were executed by that client. Only known clients (such as `kibana` or `elasticsearch`) are counted. */
clients: Record<string, integer>
/** Statistics about the clusters that were queried in cross-cluster search requests. The keys are cluster names, and the values are per-cluster telemetry data. This also includes the local cluster itself, which uses the name `(local)`. */
clusters: Record<string, ClusterStatsCCSUsageClusterStats>
}

export interface ClusterStatsCCSUsageTimeValue {
/** The maximum time taken to execute a request, in milliseconds. */
max: DurationValue<UnitMillis>
/** The average time taken to execute a request, in milliseconds. */
avg: DurationValue<UnitMillis>
/** The 90th percentile of the time taken to execute requests, in milliseconds. */
p90: DurationValue<UnitMillis>
}

export interface ClusterStatsCharFilterTypes {
/** Contains statistics about analyzer types used in selected nodes. */
analyzer_types: ClusterStatsFieldTypes[]
Expand Down Expand Up @@ -16158,6 +16214,39 @@ export interface ClusterStatsOperatingSystemMemoryInfo {
used_percent: integer
}

export interface ClusterStatsRemoteClusterInfo {
/** The UUID of the remote cluster. */
cluster_uuid: string
/** The connection mode used to communicate with the remote cluster. */
mode: string
/** The `skip_unavailable` setting used for this remote cluster. */
skip_unavailable: boolean
/** Transport compression setting used for this remote cluster. */
transport_compress: string
/** Health status of the cluster, based on the state of its primary and replica shards. */
status: HealthStatus
/** The list of Elasticsearch versions used by the nodes on the remote cluster. */
version: VersionString[]
/** The total count of nodes in the remote cluster. */
nodes_count: integer
/** The total number of shards in the remote cluster. */
shards_count: integer
/** The total number of indices in the remote cluster. */
indices_count: integer
/** Total data set size, in bytes, of all shards assigned to selected nodes. */
indices_total_size_in_bytes: long
/** Total data set size of all shards assigned to selected nodes, as a human-readable string. */
indices_total_size?: string
/** Maximum amount of memory, in bytes, available for use by the heap across the nodes of the remote cluster. */
max_heap_in_bytes: long
/** Maximum amount of memory available for use by the heap across the nodes of the remote cluster, as a human-readable string. */
max_heap?: string
/** Total amount, in bytes, of physical memory across the nodes of the remote cluster. */
mem_total_in_bytes: long
/** Total amount of physical memory across the nodes of the remote cluster, as a human-readable string. */
mem_total?: string
}

export interface ClusterStatsRequest extends RequestBase {
/** Comma-separated list of node filters used to limit returned information. Defaults to all nodes in the cluster. */
node_id?: NodeIds
Expand Down Expand Up @@ -16219,6 +16308,8 @@ export interface ClusterStatsStatsResponseBase extends NodesNodesResponseBase {
status: HealthStatus
/** Unix timestamp, in milliseconds, for the last time the cluster statistics were refreshed. */
timestamp: long
/** Cross-cluster stats */
ccs: ClusterStatsCCSStats
}

export interface ConnectorConnector {
Expand Down Expand Up @@ -17954,7 +18045,7 @@ export interface IlmExplainLifecycleLifecycleExplainManaged {
lifecycle_date?: DateTime
lifecycle_date_millis?: EpochTime<UnitMillis>
managed: true
phase: Name
phase?: Name
phase_time?: DateTime
phase_time_millis?: EpochTime<UnitMillis>
policy?: Name
Expand Down Expand Up @@ -19073,7 +19164,16 @@ export interface IndicesCloseResponse {
}

export interface IndicesCreateRequest extends RequestBase {
/** Name of the index you wish to create. */
/** Name of the index you wish to create.
* Index names must meet the following criteria:
*
* * Lowercase only
* * Cannot include `\`, `/`, `*`, `?`, `"`, `<`, `>`, `|`, ` ` (space character), `,`, or `#`
* * Indices prior to 7.0 could contain a colon (`:`), but that has been deprecated and will not be supported in later versions
* * Cannot start with `-`, `_`, or `+`
* * Cannot be `.` or `..`
* * Cannot be longer than 255 bytes (note thtat it is bytes, so multi-byte characters will reach the limit faster)
* * Names starting with `.` are deprecated, except for hidden indices and internal indices managed by plugins */
index: IndexName
/** Period to wait for a connection to the master node.
* If no response is received before the timeout expires, the request fails and returns an error. */
Expand Down Expand Up @@ -23203,16 +23303,18 @@ export interface IngestPipelineProcessor extends IngestProcessorBase {
ignore_missing_pipeline?: boolean
}

export interface IngestPipelineSimulation {
export interface IngestPipelineProcessorResult {
doc?: IngestDocumentSimulation
tag?: string
processor_type?: string
status?: WatcherActionStatusOptions
status?: IngestPipelineSimulationStatusOptions
description?: string
ignored_error?: ErrorCause
error?: ErrorCause
}

export type IngestPipelineSimulationStatusOptions = 'success' | 'error' | 'error_ignored' | 'skipped' | 'dropped'

export interface IngestProcessorBase {
/** Description of the processor.
* Useful for describing the purpose of the processor or its configuration. */
Expand Down Expand Up @@ -23491,7 +23593,7 @@ export type IngestShapeType = 'geo_shape' | 'shape'
export interface IngestSimulateDocumentResult {
doc?: IngestDocumentSimulation
error?: ErrorCause
processor_results?: IngestPipelineSimulation[]
processor_results?: IngestPipelineProcessorResult[]
}

export interface IngestSortProcessor extends IngestProcessorBase {
Expand Down