Skip to content

Commit f737f34

Browse files
kderussofloberndelasticmachineAnaetheliondependabot[bot]
authored
Add specification for new sparse vector query; deprecate specification for text_expansion and weighted_tokens queries (#2642)
* Add sparse_vector query to client specification * Fix error and update contrib * PR feedback * Populate endpoint deprecation from request definition (#2640) * Update specification output * Wrap ts-morph errors to provide helpful error (#2644) * wrap ts-morph errors to provide helpful error * improve after lint * Bump braces from 3.0.2 to 3.0.3 in /typescript-generator (#2645) Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3. - [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md) - [Commits](micromatch/braces@3.0.2...3.0.3) --- updated-dependencies: - dependency-name: braces dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * [Query Rules] Update Query Rules API for 8.15 (#2639) * Mark existing query rules APIs as GA * Add individual CRUD API calls * Linting * PR feedback * PR feedback * Update specification output * Update output * Update output * Fix variant annotations for SparseVectorQuery --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Florian Bernd <git@flobernd.de> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Laurent Saint-Félix <laurent.saintfelix@elastic.co> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent f1da80d commit f737f34

File tree

8 files changed

+2936
-42
lines changed

8 files changed

+2936
-42
lines changed

output/openapi/elasticsearch-openapi.json

Lines changed: 72 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -57225,6 +57225,9 @@
5722557225
"span_within": {
5722657226
"$ref": "#/components/schemas/_types.query_dsl:SpanWithinQuery"
5722757227
},
57228+
"sparse_vector": {
57229+
"$ref": "#/components/schemas/_types.query_dsl:SparseVectorQuery"
57230+
},
5722857231
"term": {
5722957232
"externalDocs": {
5723057233
"url": "https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-term-query.html"
@@ -57253,6 +57256,7 @@
5725357256
"maxProperties": 1
5725457257
},
5725557258
"text_expansion": {
57259+
"deprecated": true,
5725657260
"externalDocs": {
5725757261
"url": "https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-text-expansion-query.html"
5725857262
},
@@ -57265,6 +57269,7 @@
5726557269
"maxProperties": 1
5726657270
},
5726757271
"weighted_tokens": {
57272+
"deprecated": true,
5726857273
"description": "Supports returning text_expansion query results by sending in precomputed tokens with the query.",
5726957274
"type": "object",
5727057275
"additionalProperties": {
@@ -61163,6 +61168,73 @@
6116361168
}
6116461169
]
6116561170
},
61171+
"_types.query_dsl:SparseVectorQuery": {
61172+
"allOf": [
61173+
{
61174+
"$ref": "#/components/schemas/_types.query_dsl:QueryBase"
61175+
},
61176+
{
61177+
"allOf": [
61178+
{
61179+
"type": "object",
61180+
"properties": {
61181+
"field": {
61182+
"$ref": "#/components/schemas/_types:Field"
61183+
}
61184+
},
61185+
"required": [
61186+
"field"
61187+
]
61188+
},
61189+
{
61190+
"type": "object",
61191+
"properties": {
61192+
"query_vector": {
61193+
"description": "Dictionary of precomputed sparse vectors and their associated weights.\nOnly one of inference_id or query_vector may be supplied in a request.",
61194+
"type": "object",
61195+
"additionalProperties": {
61196+
"type": "number"
61197+
}
61198+
},
61199+
"inference_id": {
61200+
"$ref": "#/components/schemas/_types:Id"
61201+
},
61202+
"query": {
61203+
"description": "The query text you want to use for search.\nIf inference_id is specified, query must also be specified.",
61204+
"type": "string"
61205+
},
61206+
"prune": {
61207+
"description": "Whether to perform pruning, omitting the non-significant tokens from the query to improve query performance.\nIf prune is true but the pruning_config is not specified, pruning will occur but default values will be used.\nDefault: false",
61208+
"type": "boolean"
61209+
},
61210+
"pruning_config": {
61211+
"$ref": "#/components/schemas/_types.query_dsl:TokenPruningConfig"
61212+
}
61213+
},
61214+
"minProperties": 1,
61215+
"maxProperties": 1
61216+
}
61217+
]
61218+
}
61219+
]
61220+
},
61221+
"_types.query_dsl:TokenPruningConfig": {
61222+
"type": "object",
61223+
"properties": {
61224+
"tokens_freq_ratio_threshold": {
61225+
"description": "Tokens whose frequency is more than this threshold times the average frequency of all tokens in the specified field are considered outliers and pruned.",
61226+
"type": "number"
61227+
},
61228+
"tokens_weight_threshold": {
61229+
"description": "Tokens whose weight is less than this threshold are considered nonsignificant and pruned.",
61230+
"type": "number"
61231+
},
61232+
"only_score_pruned_tokens": {
61233+
"description": "Whether to only score pruned tokens, vs only scoring kept tokens.",
61234+
"type": "boolean"
61235+
}
61236+
}
61237+
},
6116661238
"_types.query_dsl:TermQuery": {
6116761239
"allOf": [
6116861240
{
@@ -61250,23 +61322,6 @@
6125061322
}
6125161323
]
6125261324
},
61253-
"_types.query_dsl:TokenPruningConfig": {
61254-
"type": "object",
61255-
"properties": {
61256-
"tokens_freq_ratio_threshold": {
61257-
"description": "Tokens whose frequency is more than this threshold times the average frequency of all tokens in the specified field are considered outliers and pruned.",
61258-
"type": "number"
61259-
},
61260-
"tokens_weight_threshold": {
61261-
"description": "Tokens whose weight is less than this threshold are considered nonsignificant and pruned.",
61262-
"type": "number"
61263-
},
61264-
"only_score_pruned_tokens": {
61265-
"description": "Whether to only score pruned tokens, vs only scoring kept tokens.",
61266-
"type": "boolean"
61267-
}
61268-
}
61269-
},
6127061325
"_types.query_dsl:WeightedTokensQuery": {
6127161326
"allOf": [
6127261327
{

output/openapi/elasticsearch-serverless-openapi.json

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

0 commit comments

Comments
 (0)