diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 9abc66cf84..4c9f29d771 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -262,6 +262,9 @@ { "$ref": "#/components/parameters/async_search.submit-preference" }, + { + "$ref": "#/components/parameters/async_search.submit-project_routing" + }, { "$ref": "#/components/parameters/async_search.submit-request_cache" }, @@ -421,6 +424,9 @@ { "$ref": "#/components/parameters/async_search.submit-preference" }, + { + "$ref": "#/components/parameters/async_search.submit-project_routing" + }, { "$ref": "#/components/parameters/async_search.submit-request_cache" }, @@ -23717,6 +23723,9 @@ { "$ref": "#/components/parameters/search-pre_filter_shard_size" }, + { + "$ref": "#/components/parameters/search-project_routing" + }, { "$ref": "#/components/parameters/search-request_cache" }, @@ -23878,6 +23887,9 @@ { "$ref": "#/components/parameters/search-pre_filter_shard_size" }, + { + "$ref": "#/components/parameters/search-project_routing" + }, { "$ref": "#/components/parameters/search-request_cache" }, @@ -24044,6 +24056,9 @@ { "$ref": "#/components/parameters/search-pre_filter_shard_size" }, + { + "$ref": "#/components/parameters/search-project_routing" + }, { "$ref": "#/components/parameters/search-request_cache" }, @@ -24208,6 +24223,9 @@ { "$ref": "#/components/parameters/search-pre_filter_shard_size" }, + { + "$ref": "#/components/parameters/search-project_routing" + }, { "$ref": "#/components/parameters/search-request_cache" }, @@ -35141,6 +35159,9 @@ "none" ] }, + "_types.ProjectRouting": { + "type": "string" + }, "_types.SearchType": { "type": "string", "enum": [ @@ -82899,6 +82920,17 @@ }, "style": "form" }, + "async_search.submit-project_routing": { + "in": "query", + "name": "project_routing", + "description": "Specifies a subset of projects to target for a search using project metadata\ntags in a subset Lucene syntax. Allowed Lucene queries: the _alias tag\nand a single value (possible wildcarded). Examples:\n _alias:my-project\n _alias:_origin\n _alias:*pr*\nSupported in serverless only.", + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types.ProjectRouting" + }, + "x-state": "Generally available", + "style": "form" + }, "async_search.submit-request_cache": { "in": "query", "name": "request_cache", @@ -87283,6 +87315,17 @@ }, "style": "form" }, + "search-project_routing": { + "in": "query", + "name": "project_routing", + "description": "Specifies a subset of projects to target for a search using project metadata\ntags in a subset Lucene syntax. Allowed Lucene queries: the _alias tag\nand a single value (possible wildcarded). Examples:\n _alias:my-project\n _alias:_origin\n _alias:*pr*\nSupported in serverless only.", + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types.ProjectRouting" + }, + "x-state": "Generally available", + "style": "form" + }, "search-request_cache": { "in": "query", "name": "request_cache", diff --git a/output/schema/schema.json b/output/schema/schema.json index f2fc92a22d..891c0d5084 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -38913,6 +38913,21 @@ } } }, + { + "availability": { + "serverless": {} + }, + "description": "Specifies a subset of projects to target for a search using project metadata\ntags in a subset Lucene syntax. Allowed Lucene queries: the _alias tag\nand a single value (possible wildcarded). Examples:\n _alias:my-project\n _alias:_origin\n _alias:*pr*\nSupported in serverless only.", + "name": "project_routing", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "ProjectRouting", + "namespace": "_types" + } + } + }, { "description": "If `true`, the caching of search results is enabled for requests where `size` is `0`.\nIt defaults to index level settings.", "extDocId": "shard-request-cache", @@ -39292,7 +39307,7 @@ } } ], - "specLocation": "_global/search/SearchRequest.ts#L53-L595" + "specLocation": "_global/search/SearchRequest.ts#L54-L607" }, { "kind": "response", @@ -50368,7 +50383,7 @@ "name": "AggregateName", "namespace": "_types" }, - "specLocation": "_types/common.ts#L142-L146", + "specLocation": "_types/common.ts#L144-L148", "type": { "kind": "instance_of", "type": { @@ -50566,7 +50581,7 @@ "name": "ByteSize", "namespace": "_types" }, - "specLocation": "_types/common.ts#L90-L91", + "specLocation": "_types/common.ts#L92-L93", "type": { "kind": "union_of", "items": [ @@ -50619,7 +50634,7 @@ "name": "Bytes", "namespace": "_types" }, - "specLocation": "_types/common.ts#L166-L178" + "specLocation": "_types/common.ts#L168-L180" }, { "kind": "type_alias", @@ -50642,7 +50657,7 @@ "name": "ClusterAlias", "namespace": "_types" }, - "specLocation": "_types/common.ts#L72-L72", + "specLocation": "_types/common.ts#L74-L74", "type": { "kind": "instance_of", "type": { @@ -50762,7 +50777,7 @@ "name": "ClusterInfoTarget", "namespace": "_types" }, - "specLocation": "_types/common.ts#L380-L386" + "specLocation": "_types/common.ts#L382-L388" }, { "kind": "type_alias", @@ -50770,7 +50785,7 @@ "name": "ClusterInfoTargets", "namespace": "_types" }, - "specLocation": "_types/common.ts#L388-L388", + "specLocation": "_types/common.ts#L390-L390", "type": { "kind": "union_of", "items": [ @@ -50989,7 +51004,7 @@ "name": "Conflicts", "namespace": "_types" }, - "specLocation": "_types/common.ts#L180-L189" + "specLocation": "_types/common.ts#L182-L191" }, { "kind": "interface", @@ -51120,7 +51135,7 @@ "name": "DataStreamName", "namespace": "_types" }, - "specLocation": "_types/common.ts#L86-L86", + "specLocation": "_types/common.ts#L88-L88", "type": { "kind": "instance_of", "type": { @@ -51135,7 +51150,7 @@ "name": "DataStreamNames", "namespace": "_types" }, - "specLocation": "_types/common.ts#L88-L88", + "specLocation": "_types/common.ts#L90-L90", "type": { "kind": "union_of", "items": [ @@ -51596,7 +51611,7 @@ "namespace": "_types" }, "properties": [], - "specLocation": "_types/common.ts#L157-L158" + "specLocation": "_types/common.ts#L159-L160" }, { "kind": "type_alias", @@ -51805,7 +51820,7 @@ "name": "ExpandWildcard", "namespace": "_types" }, - "specLocation": "_types/common.ts#L198-L212" + "specLocation": "_types/common.ts#L200-L214" }, { "kind": "type_alias", @@ -51813,7 +51828,7 @@ "name": "ExpandWildcards", "namespace": "_types" }, - "specLocation": "_types/common.ts#L214-L214", + "specLocation": "_types/common.ts#L216-L216", "type": { "kind": "union_of", "items": [ @@ -51844,7 +51859,7 @@ "name": "Field", "namespace": "_types" }, - "specLocation": "_types/common.ts#L135-L136", + "specLocation": "_types/common.ts#L137-L138", "type": { "kind": "instance_of", "type": { @@ -52165,7 +52180,7 @@ "name": "Fields", "namespace": "_types" }, - "specLocation": "_types/common.ts#L137-L137", + "specLocation": "_types/common.ts#L139-L139", "type": { "kind": "union_of", "items": [ @@ -52260,7 +52275,7 @@ "name": "Fuzziness", "namespace": "_types" }, - "specLocation": "_types/common.ts#L130-L131", + "specLocation": "_types/common.ts#L132-L133", "type": { "kind": "union_of", "items": [ @@ -52964,7 +52979,7 @@ "name": "GrokPattern", "namespace": "_types" }, - "specLocation": "_types/common.ts#L81-L81", + "specLocation": "_types/common.ts#L83-L83", "type": { "kind": "instance_of", "type": { @@ -53008,7 +53023,7 @@ "name": "HealthStatus", "namespace": "_types" }, - "specLocation": "_types/common.ts#L216-L238" + "specLocation": "_types/common.ts#L218-L240" }, { "kind": "type_alias", @@ -53031,7 +53046,7 @@ "name": "HttpHeaders", "namespace": "_types" }, - "specLocation": "_types/common.ts#L155-L155", + "specLocation": "_types/common.ts#L157-L157", "type": { "kind": "dictionary_of", "key": { @@ -53530,7 +53545,7 @@ } } ], - "specLocation": "_types/common.ts#L334-L361" + "specLocation": "_types/common.ts#L336-L363" }, { "kind": "interface", @@ -53673,7 +53688,7 @@ } } ], - "specLocation": "_types/common.ts#L319-L332" + "specLocation": "_types/common.ts#L321-L334" }, { "kind": "interface", @@ -54178,7 +54193,7 @@ "name": "Level", "namespace": "_types" }, - "specLocation": "_types/common.ts#L248-L252" + "specLocation": "_types/common.ts#L250-L254" }, { "kind": "enum", @@ -54511,7 +54526,7 @@ "name": "Metadata", "namespace": "_types" }, - "specLocation": "_types/common.ts#L93-L93", + "specLocation": "_types/common.ts#L95-L95", "type": { "kind": "dictionary_of", "key": { @@ -54533,7 +54548,7 @@ "name": "Metrics", "namespace": "_types" }, - "specLocation": "_types/common.ts#L70-L70", + "specLocation": "_types/common.ts#L72-L72", "type": { "kind": "union_of", "items": [ @@ -54566,7 +54581,7 @@ "name": "MinimumShouldMatch", "namespace": "_types" }, - "specLocation": "_types/common.ts#L160-L164", + "specLocation": "_types/common.ts#L162-L166", "type": { "kind": "union_of", "items": [ @@ -54595,7 +54610,7 @@ "name": "MultiTermQueryRewrite", "namespace": "_types" }, - "specLocation": "_types/common.ts#L132-L133", + "specLocation": "_types/common.ts#L134-L135", "type": { "kind": "instance_of", "type": { @@ -54610,7 +54625,7 @@ "name": "Name", "namespace": "_types" }, - "specLocation": "_types/common.ts#L74-L74", + "specLocation": "_types/common.ts#L76-L76", "type": { "kind": "instance_of", "type": { @@ -54625,7 +54640,7 @@ "name": "Names", "namespace": "_types" }, - "specLocation": "_types/common.ts#L75-L75", + "specLocation": "_types/common.ts#L77-L77", "type": { "kind": "union_of", "items": [ @@ -54655,7 +54670,7 @@ "name": "Namespace", "namespace": "_types" }, - "specLocation": "_types/common.ts#L77-L77", + "specLocation": "_types/common.ts#L79-L79", "type": { "kind": "instance_of", "type": { @@ -54852,7 +54867,7 @@ "name": "NodeName", "namespace": "_types" }, - "specLocation": "_types/common.ts#L83-L84", + "specLocation": "_types/common.ts#L85-L86", "type": { "kind": "instance_of", "type": { @@ -55189,7 +55204,7 @@ "name": "OpType", "namespace": "_types" }, - "specLocation": "_types/common.ts#L254-L263" + "specLocation": "_types/common.ts#L256-L265" }, { "kind": "type_alias", @@ -55197,7 +55212,7 @@ "name": "Password", "namespace": "_types" }, - "specLocation": "_types/common.ts#L192-L192", + "specLocation": "_types/common.ts#L194-L194", "type": { "kind": "instance_of", "type": { @@ -55306,7 +55321,7 @@ "name": "PipelineName", "namespace": "_types" }, - "specLocation": "_types/common.ts#L80-L80", + "specLocation": "_types/common.ts#L82-L82", "type": { "kind": "instance_of", "type": { @@ -55427,13 +55442,28 @@ ], "specLocation": "_types/Stats.ts#L207-L217" }, + { + "kind": "type_alias", + "name": { + "name": "ProjectRouting", + "namespace": "_types" + }, + "specLocation": "_types/common.ts#L66-L66", + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, { "kind": "type_alias", "name": { "name": "PropertyName", "namespace": "_types" }, - "specLocation": "_types/common.ts#L127-L127", + "specLocation": "_types/common.ts#L129-L129", "type": { "kind": "instance_of", "type": { @@ -55785,7 +55815,7 @@ "name": "Refresh", "namespace": "_types" }, - "specLocation": "_types/common.ts#L265-L272" + "specLocation": "_types/common.ts#L267-L274" }, { "kind": "interface", @@ -55887,7 +55917,7 @@ "name": "RelationName", "namespace": "_types" }, - "specLocation": "_types/common.ts#L128-L128", + "specLocation": "_types/common.ts#L130-L130", "type": { "kind": "instance_of", "type": { @@ -56314,7 +56344,7 @@ "name": "Routing", "namespace": "_types" }, - "specLocation": "_types/common.ts#L66-L66", + "specLocation": "_types/common.ts#L68-L68", "type": { "kind": "instance_of", "type": { @@ -57218,7 +57248,7 @@ "name": "SearchType", "namespace": "_types" }, - "specLocation": "_types/common.ts#L274-L279" + "specLocation": "_types/common.ts#L276-L281" }, { "kind": "interface", @@ -57523,7 +57553,7 @@ "name": "SequenceNumber", "namespace": "_types" }, - "specLocation": "_types/common.ts#L125-L125", + "specLocation": "_types/common.ts#L127-L127", "type": { "kind": "instance_of", "type": { @@ -57538,7 +57568,7 @@ "name": "Service", "namespace": "_types" }, - "specLocation": "_types/common.ts#L78-L78", + "specLocation": "_types/common.ts#L80-L80", "type": { "kind": "instance_of", "type": { @@ -57778,7 +57808,7 @@ "name": "Slices", "namespace": "_types" }, - "specLocation": "_types/common.ts#L363-L368", + "specLocation": "_types/common.ts#L365-L370", "type": { "kind": "union_of", "items": [ @@ -57811,7 +57841,7 @@ "name": "SlicesCalculation", "namespace": "_types" }, - "specLocation": "_types/common.ts#L370-L378" + "specLocation": "_types/common.ts#L372-L380" }, { "kind": "type_alias", @@ -58306,7 +58336,7 @@ "name": "SuggestMode", "namespace": "_types" }, - "specLocation": "_types/common.ts#L281-L294" + "specLocation": "_types/common.ts#L283-L296" }, { "kind": "type_alias", @@ -58315,7 +58345,7 @@ "name": "SuggestionName", "namespace": "_types" }, - "specLocation": "_types/common.ts#L148-L152", + "specLocation": "_types/common.ts#L150-L154", "type": { "kind": "instance_of", "type": { @@ -58384,7 +58414,7 @@ "name": "TaskId", "namespace": "_types" }, - "specLocation": "_types/common.ts#L129-L129", + "specLocation": "_types/common.ts#L131-L131", "type": { "kind": "instance_of", "type": { @@ -58524,7 +58554,7 @@ "name": "ThreadType", "namespace": "_types" }, - "specLocation": "_types/common.ts#L296-L302" + "specLocation": "_types/common.ts#L298-L304" }, { "kind": "type_alias", @@ -58929,7 +58959,7 @@ "name": "Username", "namespace": "_types" }, - "specLocation": "_types/common.ts#L191-L191", + "specLocation": "_types/common.ts#L193-L193", "type": { "kind": "instance_of", "type": { @@ -58944,7 +58974,7 @@ "name": "Uuid", "namespace": "_types" }, - "specLocation": "_types/common.ts#L122-L122", + "specLocation": "_types/common.ts#L124-L124", "type": { "kind": "instance_of", "type": { @@ -58959,7 +58989,7 @@ "name": "VersionNumber", "namespace": "_types" }, - "specLocation": "_types/common.ts#L96-L96", + "specLocation": "_types/common.ts#L98-L98", "type": { "kind": "instance_of", "type": { @@ -58974,7 +59004,7 @@ "name": "VersionString", "namespace": "_types" }, - "specLocation": "_types/common.ts#L98-L98", + "specLocation": "_types/common.ts#L100-L100", "type": { "kind": "instance_of", "type": { @@ -59007,7 +59037,7 @@ "name": "VersionType", "namespace": "_types" }, - "specLocation": "_types/common.ts#L100-L119" + "specLocation": "_types/common.ts#L102-L121" }, { "kind": "enum", @@ -59023,7 +59053,7 @@ "name": "WaitForActiveShardOptions", "namespace": "_types" }, - "specLocation": "_types/common.ts#L304-L308" + "specLocation": "_types/common.ts#L306-L310" }, { "kind": "type_alias", @@ -59035,7 +59065,7 @@ "name": "WaitForActiveShards", "namespace": "_types" }, - "specLocation": "_types/common.ts#L139-L140", + "specLocation": "_types/common.ts#L141-L142", "type": { "kind": "union_of", "items": [ @@ -59082,7 +59112,7 @@ "name": "WaitForEvents", "namespace": "_types" }, - "specLocation": "_types/common.ts#L310-L317" + "specLocation": "_types/common.ts#L312-L319" }, { "kind": "interface", @@ -98814,6 +98844,21 @@ } } }, + { + "availability": { + "serverless": {} + }, + "description": "Specifies a subset of projects to target for a search using project metadata\ntags in a subset Lucene syntax. Allowed Lucene queries: the _alias tag\nand a single value (possible wildcarded). Examples:\n _alias:my-project\n _alias:_origin\n _alias:*pr*\nSupported in serverless only.", + "name": "project_routing", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "ProjectRouting", + "namespace": "_types" + } + } + }, { "description": "Specify if request cache should be used for this request or not, defaults to true", "name": "request_cache", @@ -99122,7 +99167,7 @@ } } ], - "specLocation": "async_search/submit/AsyncSearchSubmitRequest.ts#L54-L294" + "specLocation": "async_search/submit/AsyncSearchSubmitRequest.ts#L55-L306" }, { "kind": "response", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 1bea18a6f8..706308051d 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -1151,6 +1151,7 @@ export interface SearchRequest extends RequestBase { max_concurrent_shard_requests?: integer preference?: string pre_filter_shard_size?: long + project_routing?: ProjectRouting request_cache?: boolean routing?: Routing scroll?: Duration @@ -2674,6 +2675,8 @@ export interface PluginStats { licensed: boolean } +export type ProjectRouting = string + export type PropertyName = string export interface QueryCacheStats { @@ -7052,6 +7055,7 @@ export interface AsyncSearchSubmitRequest extends RequestBase { lenient?: boolean max_concurrent_shard_requests?: integer preference?: string + project_routing?: ProjectRouting request_cache?: boolean routing?: Routing search_type?: SearchType diff --git a/specification/_global/search/SearchRequest.ts b/specification/_global/search/SearchRequest.ts index a83a518c48..f4738466e1 100644 --- a/specification/_global/search/SearchRequest.ts +++ b/specification/_global/search/SearchRequest.ts @@ -25,6 +25,7 @@ import { Fields, IndexName, Indices, + ProjectRouting, Routing, SearchType, SuggestMode @@ -219,6 +220,17 @@ export interface Request extends RequestBase { * * The primary sort of the query targets an indexed field. */ pre_filter_shard_size?: long + /** + * Specifies a subset of projects to target for a search using project metadata + * tags in a subset Lucene syntax. Allowed Lucene queries: the _alias tag + * and a single value (possible wildcarded). Examples: + * _alias:my-project + * _alias:_origin + * _alias:*pr* + * Supported in serverless only. + * @availability serverless + */ + project_routing?: ProjectRouting /** * If `true`, the caching of search results is enabled for requests where `size` is `0`. * It defaults to index level settings. diff --git a/specification/_json_spec/async_search.submit.json b/specification/_json_spec/async_search.submit.json index d0d3a7c58b..70a6c2f25d 100644 --- a/specification/_json_spec/async_search.submit.json +++ b/specification/_json_spec/async_search.submit.json @@ -118,6 +118,10 @@ "type": "string", "description": "Specify the node or shard the operation should be performed on (default: random)" }, + "project_routing": { + "type": "string", + "description": "A Lucene query using project metadata tags to limit which projects to search, such as _alias:_origin or _alias:*pr*. Only supported in serverless." + }, "rest_total_hits_as_int": { "type": "boolean", "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response", diff --git a/specification/_json_spec/search.json b/specification/_json_spec/search.json index 8c678bca72..be7ae17635 100644 --- a/specification/_json_spec/search.json +++ b/specification/_json_spec/search.json @@ -100,6 +100,10 @@ "type": "string", "description": "Specify the node or shard the operation should be performed on (default: random)" }, + "project_routing": { + "type": "string", + "description": "A Lucene query using project metadata tags to limit which projects to search, such as _alias:_origin or _alias:*pr*. Only supported in serverless." + }, "q": { "type": "string", "description": "Query in the Lucene query string syntax" diff --git a/specification/_types/common.ts b/specification/_types/common.ts index 829996095b..7a48e4a689 100644 --- a/specification/_types/common.ts +++ b/specification/_types/common.ts @@ -63,6 +63,8 @@ export type IndexAlias = string export type IndexPattern = string export type IndexPatterns = IndexPattern[] +export type ProjectRouting = string + export type Routing = string export type LongId = string //TODO encode metrics as API specific enums diff --git a/specification/async_search/submit/AsyncSearchSubmitRequest.ts b/specification/async_search/submit/AsyncSearchSubmitRequest.ts index 1279697dac..dd028e2437 100644 --- a/specification/async_search/submit/AsyncSearchSubmitRequest.ts +++ b/specification/async_search/submit/AsyncSearchSubmitRequest.ts @@ -25,6 +25,7 @@ import { Fields, IndexName, Indices, + ProjectRouting, Routing, SearchType, SuggestMode @@ -126,6 +127,17 @@ export interface Request extends RequestBase { lenient?: boolean max_concurrent_shard_requests?: integer preference?: string + /** + * Specifies a subset of projects to target for a search using project metadata + * tags in a subset Lucene syntax. Allowed Lucene queries: the _alias tag + * and a single value (possible wildcarded). Examples: + * _alias:my-project + * _alias:_origin + * _alias:*pr* + * Supported in serverless only. + * @availability serverless + */ + project_routing?: ProjectRouting /** @server_default true */ request_cache?: boolean routing?: Routing