Skip to content

Commit 24a471c

Browse files
Auto-generated code for 8.14 (#2253)
1 parent aeda5cc commit 24a471c

File tree

4 files changed

+19
-10
lines changed

4 files changed

+19
-10
lines changed

docs/reference.asciidoc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2483,7 +2483,6 @@ that uses deprecated components, Elasticsearch will emit a deprecation warning.
24832483
** *`create` (Optional, boolean)*: If `true`, this request cannot replace or update existing component templates.
24842484
** *`master_timeout` (Optional, string | -1 | 0)*: Period to wait for a connection to the master node.
24852485
If no response is received before the timeout expires, the request fails and returns an error.
2486-
** *`cause` (Optional, string)*
24872486

24882487
[discrete]
24892488
==== put_settings
@@ -2814,19 +2813,19 @@ Executes an ESQL request
28142813
{ref}/esql-rest.html[Endpoint documentation]
28152814
[source,ts]
28162815
----
2817-
client.esql.query({ query, version })
2816+
client.esql.query({ query })
28182817
----
28192818

28202819
[discrete]
28212820
==== Arguments
28222821

28232822
* *Request (object):*
28242823
** *`query` (string)*: The ES|QL query API accepts an ES|QL query string in the query parameter, runs it, and returns the results.
2825-
** *`version` (Enum("2024.04.01"))*: The version of the ES|QL language in which the "query" field was written.
28262824
** *`columnar` (Optional, boolean)*: By default, ES|QL returns results as rows. For example, FROM returns each individual document as one row. For the JSON, YAML, CBOR and smile formats, ES|QL can return the results in a columnar fashion where one row represents all the values of a certain column in the results.
28272825
** *`filter` (Optional, { bool, boosting, common, combined_fields, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, knn, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule_query, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, text_expansion, weighted_tokens, wildcard, wrapper, type })*: Specify a Query DSL query in the filter parameter to filter the set of documents that an ES|QL query runs on.
28282826
** *`locale` (Optional, string)*
28292827
** *`params` (Optional, number | number | string | boolean | null[])*: To avoid any attempts of hacking or code injection, extract the values in a separate list of parameters. Use question mark placeholders (?) in the query string for each of the parameters.
2828+
** *`version` (Optional, Enum("2024.04.01"))*: The version of the ES|QL language in which the "query" field was written.
28302829
** *`format` (Optional, string)*: A short version of the Accept header, e.g. json, yaml.
28312830
** *`delimiter` (Optional, string)*: The character to use between values within a CSV row. Only valid for the CSV format.
28322831

@@ -4253,7 +4252,7 @@ a new date field is added instead of string.
42534252
not used at all by Elasticsearch, but can be used to store
42544253
application-specific metadata.
42554254
** *`numeric_detection` (Optional, boolean)*: Automatically map strings into numeric data types for all fields.
4256-
** *`properties` (Optional, Record<string, { type } | { boost, fielddata, index, null_value, type } | { type, enabled, null_value, boost, coerce, script, on_script_error, ignore_malformed, time_series_metric, analyzer, eager_global_ordinals, index, index_options, index_phrases, index_prefixes, norms, position_increment_gap, search_analyzer, search_quote_analyzer, term_vector, format, precision_step, locale } | { relations, eager_global_ordinals, type } | { boost, eager_global_ordinals, index, index_options, normalizer, norms, null_value, split_queries_on_whitespace, time_series_dimension, type } | { type, fields, meta, copy_to } | { type } | { positive_score_impact, type } | { positive_score_impact, type } | { analyzer, index, index_options, max_shingle_size, norms, search_analyzer, search_quote_analyzer, term_vector, type } | { analyzer, boost, eager_global_ordinals, fielddata, fielddata_frequency_filter, index, index_options, index_phrases, index_prefixes, norms, position_increment_gap, search_analyzer, search_quote_analyzer, term_vector, type } | { type } | { type, null_value } | { boost, format, ignore_malformed, index, null_value, precision_step, type } | { boost, fielddata, format, ignore_malformed, index, null_value, precision_step, locale, type } | { type, default_metric, metrics, time_series_metric } | { type, dims, similarity, index, index_options } | { type } | { boost, depth_limit, doc_values, eager_global_ordinals, index, index_options, null_value, similarity, split_queries_on_whitespace, type } | { enabled, include_in_parent, include_in_root, type } | { enabled, subobjects, type } | { analyzer, contexts, max_input_length, preserve_position_increments, preserve_separators, search_analyzer, type } | { value, type } | { path, type } | { ignore_malformed, type } | { boost, index, ignore_malformed, null_value, on_script_error, script, time_series_dimension, type } | { type } | { analyzer, boost, index, null_value, enable_position_increments, type } | { ignore_malformed, ignore_z_value, null_value, index, on_script_error, script, type } | { coerce, ignore_malformed, ignore_z_value, orientation, strategy, type } | { ignore_malformed, ignore_z_value, null_value, type } | { coerce, ignore_malformed, ignore_z_value, orientation, type } | { type, null_value } | { type, null_value } | { type, null_value } | { type, null_value } | { type, null_value } | { type, null_value } | { type, null_value, scaling_factor } | { type, null_value } | { type, null_value } | { format, type } | { type } | { type } | { type } | { type } | { type }>)*: Mapping for a field. For new fields, this mapping can include:
4255+
** *`properties` (Optional, Record<string, { type } | { boost, fielddata, index, null_value, type } | { type, enabled, null_value, boost, coerce, script, on_script_error, ignore_malformed, time_series_metric, analyzer, eager_global_ordinals, index, index_options, index_phrases, index_prefixes, norms, position_increment_gap, search_analyzer, search_quote_analyzer, term_vector, format, precision_step, locale } | { relations, eager_global_ordinals, type } | { boost, eager_global_ordinals, index, index_options, normalizer, norms, null_value, split_queries_on_whitespace, time_series_dimension, type } | { type, fields, meta, copy_to } | { type } | { positive_score_impact, type } | { positive_score_impact, type } | { analyzer, index, index_options, max_shingle_size, norms, search_analyzer, search_quote_analyzer, term_vector, type } | { analyzer, boost, eager_global_ordinals, fielddata, fielddata_frequency_filter, index, index_options, index_phrases, index_prefixes, norms, position_increment_gap, search_analyzer, search_quote_analyzer, term_vector, type } | { type } | { type, null_value } | { boost, format, ignore_malformed, index, null_value, precision_step, type } | { boost, fielddata, format, ignore_malformed, index, null_value, precision_step, locale, type } | { type, default_metric, metrics, time_series_metric } | { type, element_type, dims, similarity, index, index_options } | { type } | { boost, depth_limit, doc_values, eager_global_ordinals, index, index_options, null_value, similarity, split_queries_on_whitespace, type } | { enabled, include_in_parent, include_in_root, type } | { enabled, subobjects, type } | { analyzer, contexts, max_input_length, preserve_position_increments, preserve_separators, search_analyzer, type } | { value, type } | { path, type } | { ignore_malformed, type } | { boost, index, ignore_malformed, null_value, on_script_error, script, time_series_dimension, type } | { type } | { analyzer, boost, index, null_value, enable_position_increments, type } | { ignore_malformed, ignore_z_value, null_value, index, on_script_error, script, type } | { coerce, ignore_malformed, ignore_z_value, orientation, strategy, type } | { ignore_malformed, ignore_z_value, null_value, type } | { coerce, ignore_malformed, ignore_z_value, orientation, type } | { type, null_value } | { type, null_value } | { type, null_value } | { type, null_value } | { type, null_value } | { type, null_value } | { type, null_value, scaling_factor } | { type, null_value } | { type, null_value } | { format, type } | { type } | { type } | { type } | { type } | { type }>)*: Mapping for a field. For new fields, this mapping can include:
42574256

42584257
- Field name
42594258
- Field data type

src/api/api/esql.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ export default class Esql {
6363
body = userBody != null ? { ...userBody } : undefined
6464
}
6565

66+
// a version number is required for all ES|QL queries.
67+
// inject a default value if none is provided.
68+
if (typeof body === 'object' && body.version == null) {
69+
body.version = '2024.04.01'
70+
}
71+
6672
for (const key in params) {
6773
if (acceptedBody.includes(key)) {
6874
body = body ?? {}

src/api/types.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2760,7 +2760,7 @@ export interface WriteResponseBase {
27602760
_index: IndexName
27612761
_primary_term?: long
27622762
result: Result
2763-
_seq_no: SequenceNumber
2763+
_seq_no?: SequenceNumber
27642764
_shards: ShardStatistics
27652765
_version: VersionNumber
27662766
forced_refresh?: boolean
@@ -2787,6 +2787,7 @@ export interface AggregationsAdjacencyMatrixAggregate extends AggregationsMultiB
27872787

27882788
export interface AggregationsAdjacencyMatrixAggregation extends AggregationsBucketAggregationBase {
27892789
filters?: Record<string, QueryDslQueryContainer>
2790+
separator?: string
27902791
}
27912792

27922793
export interface AggregationsAdjacencyMatrixBucketKeys extends AggregationsMultiBucketBase {
@@ -4901,6 +4902,7 @@ export interface MappingDenseVectorIndexOptions {
49014902

49024903
export interface MappingDenseVectorProperty extends MappingPropertyBase {
49034904
type: 'dense_vector'
4905+
element_type?: string
49044906
dims?: integer
49054907
similarity?: string
49064908
index?: boolean
@@ -8584,7 +8586,6 @@ export interface ClusterPutComponentTemplateRequest extends RequestBase {
85848586
name: Name
85858587
create?: boolean
85868588
master_timeout?: Duration
8587-
cause?: string
85888589
template: IndicesIndexState
85898590
version?: VersionNumber
85908591
_meta?: Metadata
@@ -9662,7 +9663,7 @@ export interface EsqlQueryRequest extends RequestBase {
96629663
locale?: string
96639664
params?: ScalarValue[]
96649665
query: string
9665-
version: EsqlEsqlVersion
9666+
version?: EsqlEsqlVersion
96669667
}
96679668

96689669
export type EsqlQueryResponse = EsqlColumns
@@ -12186,6 +12187,7 @@ export interface IngestProcessorContainer {
1218612187

1218712188
export interface IngestRemoveProcessor extends IngestProcessorBase {
1218812189
field: Fields
12190+
keep?: Fields
1218912191
ignore_missing?: boolean
1219012192
}
1219112193

src/api/typesWithBodyKey.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2833,7 +2833,7 @@ export interface WriteResponseBase {
28332833
_index: IndexName
28342834
_primary_term?: long
28352835
result: Result
2836-
_seq_no: SequenceNumber
2836+
_seq_no?: SequenceNumber
28372837
_shards: ShardStatistics
28382838
_version: VersionNumber
28392839
forced_refresh?: boolean
@@ -2860,6 +2860,7 @@ export interface AggregationsAdjacencyMatrixAggregate extends AggregationsMultiB
28602860

28612861
export interface AggregationsAdjacencyMatrixAggregation extends AggregationsBucketAggregationBase {
28622862
filters?: Record<string, QueryDslQueryContainer>
2863+
separator?: string
28632864
}
28642865

28652866
export interface AggregationsAdjacencyMatrixBucketKeys extends AggregationsMultiBucketBase {
@@ -4974,6 +4975,7 @@ export interface MappingDenseVectorIndexOptions {
49744975

49754976
export interface MappingDenseVectorProperty extends MappingPropertyBase {
49764977
type: 'dense_vector'
4978+
element_type?: string
49774979
dims?: integer
49784980
similarity?: string
49794981
index?: boolean
@@ -8676,7 +8678,6 @@ export interface ClusterPutComponentTemplateRequest extends RequestBase {
86768678
name: Name
86778679
create?: boolean
86788680
master_timeout?: Duration
8679-
cause?: string
86808681
/** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */
86818682
body?: {
86828683
template: IndicesIndexState
@@ -9819,7 +9820,7 @@ export interface EsqlQueryRequest extends RequestBase {
98199820
locale?: string
98209821
params?: ScalarValue[]
98219822
query: string
9822-
version: EsqlEsqlVersion
9823+
version?: EsqlEsqlVersion
98239824
}
98249825
}
98259826

@@ -12411,6 +12412,7 @@ export interface IngestProcessorContainer {
1241112412

1241212413
export interface IngestRemoveProcessor extends IngestProcessorBase {
1241312414
field: Fields
12415+
keep?: Fields
1241412416
ignore_missing?: boolean
1241512417
}
1241612418

0 commit comments

Comments
 (0)