@@ -889,6 +889,7 @@ async def count(
889889 min_score : t .Optional [float ] = None ,
890890 preference : t .Optional [str ] = None ,
891891 pretty : t .Optional [bool ] = None ,
892+ project_routing : t .Optional [str ] = None ,
892893 q : t .Optional [str ] = None ,
893894 query : t .Optional [t .Mapping [str , t .Any ]] = None ,
894895 routing : t .Optional [str ] = None ,
@@ -943,6 +944,10 @@ async def count(
943944 in the result.
944945 :param preference: The node or shard the operation should be performed on. By
945946 default, it is random.
947+ :param project_routing: Specifies a subset of projects to target for the search
948+ using project metadata tags in a subset of Lucene query syntax. Allowed Lucene
949+ queries: the _alias tag and a single value (possibly wildcarded). Examples:
950+ _alias:my-project _alias:_origin _alias:*pr* Supported in serverless only.
946951 :param q: The query in Lucene query string syntax. This parameter cannot be used
947952 with a request body.
948953 :param query: Defines the search query using Query DSL. A request body query
@@ -995,6 +1000,8 @@ async def count(
9951000 __query ["preference" ] = preference
9961001 if pretty is not None :
9971002 __query ["pretty" ] = pretty
1003+ if project_routing is not None :
1004+ __query ["project_routing" ] = project_routing
9981005 if q is not None :
9991006 __query ["q" ] = q
10001007 if routing is not None :
@@ -2133,6 +2140,7 @@ async def field_caps(
21332140 include_unmapped : t .Optional [bool ] = None ,
21342141 index_filter : t .Optional [t .Mapping [str , t .Any ]] = None ,
21352142 pretty : t .Optional [bool ] = None ,
2143+ project_routing : t .Optional [str ] = None ,
21362144 runtime_mappings : t .Optional [t .Mapping [str , t .Mapping [str , t .Any ]]] = None ,
21372145 types : t .Optional [t .Sequence [str ]] = None ,
21382146 body : t .Optional [t .Dict [str , t .Any ]] = None ,
@@ -2176,6 +2184,11 @@ async def field_caps(
21762184 deleted documents) are outside of the provided range. However, not all queries
21772185 can rewrite to `match_none` so this API may return an index even if the provided
21782186 filter matches no document.
2187+ :param project_routing: Specifies a subset of projects to target for the field-caps
2188+ query using project metadata tags in a subset of Lucene query syntax. Allowed
2189+ Lucene queries: the _alias tag and a single value (possibly wildcarded).
2190+ Examples: _alias:my-project _alias:_origin _alias:*pr* Supported in serverless
2191+ only.
21792192 :param runtime_mappings: Define ad-hoc runtime fields in the request similar
21802193 to the way it is done in search requests. These fields exist only as part
21812194 of the query and take precedence over fields defined with the same name in
@@ -2213,6 +2226,8 @@ async def field_caps(
22132226 __query ["include_unmapped" ] = include_unmapped
22142227 if pretty is not None :
22152228 __query ["pretty" ] = pretty
2229+ if project_routing is not None :
2230+ __query ["project_routing" ] = project_routing
22162231 if types is not None :
22172232 __query ["types" ] = types
22182233 if not __body :
@@ -3151,6 +3166,7 @@ async def msearch(
31513166 max_concurrent_shard_requests : t .Optional [int ] = None ,
31523167 pre_filter_shard_size : t .Optional [int ] = None ,
31533168 pretty : t .Optional [bool ] = None ,
3169+ project_routing : t .Optional [str ] = None ,
31543170 rest_total_hits_as_int : t .Optional [bool ] = None ,
31553171 routing : t .Optional [str ] = None ,
31563172 search_type : t .Optional [
@@ -3212,6 +3228,10 @@ async def msearch(
32123228 roundtrip can limit the number of shards significantly if for instance a
32133229 shard can not match any documents based on its rewrite method i.e., if date
32143230 filters are mandatory to match but the shard bounds and the query are disjoint.
3231+ :param project_routing: Specifies a subset of projects to target for a search
3232+ using project metadata tags in a subset Lucene syntax. Allowed Lucene queries:
3233+ the _alias tag and a single value (possible wildcarded). Examples: _alias:my-project
3234+ _alias:_origin _alias:*pr* Supported in serverless only.
32153235 :param rest_total_hits_as_int: If true, hits.total are returned as an integer
32163236 in the response. Defaults to false, which returns an object.
32173237 :param routing: Custom routing value used to route search operations to a specific
@@ -3261,6 +3281,8 @@ async def msearch(
32613281 __query ["pre_filter_shard_size" ] = pre_filter_shard_size
32623282 if pretty is not None :
32633283 __query ["pretty" ] = pretty
3284+ if project_routing is not None :
3285+ __query ["project_routing" ] = project_routing
32643286 if rest_total_hits_as_int is not None :
32653287 __query ["rest_total_hits_as_int" ] = rest_total_hits_as_int
32663288 if routing is not None :
@@ -3299,6 +3321,7 @@ async def msearch_template(
32993321 human : t .Optional [bool ] = None ,
33003322 max_concurrent_searches : t .Optional [int ] = None ,
33013323 pretty : t .Optional [bool ] = None ,
3324+ project_routing : t .Optional [str ] = None ,
33023325 rest_total_hits_as_int : t .Optional [bool ] = None ,
33033326 search_type : t .Optional [
33043327 t .Union [str , t .Literal ["dfs_query_then_fetch" , "query_then_fetch" ]]
@@ -3332,6 +3355,10 @@ async def msearch_template(
33323355 for cross-cluster search requests.
33333356 :param max_concurrent_searches: The maximum number of concurrent searches the
33343357 API can run.
3358+ :param project_routing: Specifies a subset of projects to target for the search
3359+ using project metadata tags in a subset of Lucene query syntax. Allowed Lucene
3360+ queries: the _alias tag and a single value (possibly wildcarded). Examples:
3361+ _alias:my-project _alias:_origin _alias:*pr* Supported in serverless only.
33353362 :param rest_total_hits_as_int: If `true`, the response returns `hits.total` as
33363363 an integer. If `false`, it returns `hits.total` as an object.
33373364 :param search_type: The type of the search operation.
@@ -3364,6 +3391,8 @@ async def msearch_template(
33643391 __query ["max_concurrent_searches" ] = max_concurrent_searches
33653392 if pretty is not None :
33663393 __query ["pretty" ] = pretty
3394+ if project_routing is not None :
3395+ __query ["project_routing" ] = project_routing
33673396 if rest_total_hits_as_int is not None :
33683397 __query ["rest_total_hits_as_int" ] = rest_total_hits_as_int
33693398 if search_type is not None :
@@ -3534,6 +3563,7 @@ async def open_point_in_time(
35343563 max_concurrent_shard_requests : t .Optional [int ] = None ,
35353564 preference : t .Optional [str ] = None ,
35363565 pretty : t .Optional [bool ] = None ,
3566+ project_routing : t .Optional [str ] = None ,
35373567 routing : t .Optional [str ] = None ,
35383568 body : t .Optional [t .Dict [str , t .Any ]] = None ,
35393569 ) -> ObjectApiResponse [t .Any ]:
@@ -3590,6 +3620,11 @@ async def open_point_in_time(
35903620 that each sub-search request executes per node.
35913621 :param preference: The node or shard the operation should be performed on. By
35923622 default, it is random.
3623+ :param project_routing: Specifies a subset of projects to target for the PIT
3624+ request using project metadata tags in a subset of Lucene query syntax. Allowed
3625+ Lucene queries: the _alias tag and a single value (possibly wildcarded).
3626+ Examples: _alias:my-project _alias:_origin _alias:*pr* Supported in serverless
3627+ only.
35933628 :param routing: A custom value that is used to route operations to a specific
35943629 shard.
35953630 """
@@ -3621,6 +3656,8 @@ async def open_point_in_time(
36213656 __query ["preference" ] = preference
36223657 if pretty is not None :
36233658 __query ["pretty" ] = pretty
3659+ if project_routing is not None :
3660+ __query ["project_routing" ] = project_routing
36243661 if routing is not None :
36253662 __query ["routing" ] = routing
36263663 if not __body :
@@ -4377,6 +4414,7 @@ async def search(
43774414 preference : t .Optional [str ] = None ,
43784415 pretty : t .Optional [bool ] = None ,
43794416 profile : t .Optional [bool ] = None ,
4417+ project_routing : t .Optional [str ] = None ,
43804418 q : t .Optional [str ] = None ,
43814419 query : t .Optional [t .Mapping [str , t .Any ]] = None ,
43824420 rank : t .Optional [t .Mapping [str , t .Any ]] = None ,
@@ -4560,6 +4598,10 @@ async def search(
45604598 :param profile: Set to `true` to return detailed timing information about the
45614599 execution of individual components in a search request. NOTE: This is a debugging
45624600 tool and adds significant overhead to search execution.
4601+ :param project_routing: Specifies a subset of projects to target for the search
4602+ using project metadata tags in a subset of Lucene query syntax. Allowed Lucene
4603+ queries: the _alias tag and a single value (possibly wildcarded). Examples:
4604+ _alias:my-project _alias:_origin _alias:*pr* Supported in serverless only.
45634605 :param q: A query in the Lucene query string syntax. Query parameter searches
45644606 do not support the full Elasticsearch Query DSL but are handy for testing.
45654607 IMPORTANT: This parameter overrides the query parameter in the request body.
@@ -4714,6 +4756,8 @@ async def search(
47144756 __query ["preference" ] = preference
47154757 if pretty is not None :
47164758 __query ["pretty" ] = pretty
4759+ if project_routing is not None :
4760+ __query ["project_routing" ] = project_routing
47174761 if q is not None :
47184762 __query ["q" ] = q
47194763 if request_cache is not None :
@@ -4868,6 +4912,7 @@ async def search_mvt(
48684912 ] = None ,
48694913 human : t .Optional [bool ] = None ,
48704914 pretty : t .Optional [bool ] = None ,
4915+ project_routing : t .Optional [str ] = None ,
48714916 query : t .Optional [t .Mapping [str , t .Any ]] = None ,
48724917 runtime_mappings : t .Optional [t .Mapping [str , t .Mapping [str , t .Any ]]] = None ,
48734918 size : t .Optional [int ] = None ,
@@ -5185,6 +5230,10 @@ async def search_mvt(
51855230 In the aggs layer, each feature represents a `geotile_grid` cell. If `grid,
51865231 each feature is a polygon of the cells bounding box. If `point`, each feature
51875232 is a Point that is the centroid of the cell.
5233+ :param project_routing: Specifies a subset of projects to target for the search
5234+ using project metadata tags in a subset of Lucene query syntax. Allowed Lucene
5235+ queries: the _alias tag and a single value (possibly wildcarded). Examples:
5236+ _alias:my-project _alias:_origin _alias:*pr* Supported in serverless only.
51885237 :param query: The query DSL used to filter documents for the search.
51895238 :param runtime_mappings: Defines one or more runtime fields in the search request.
51905239 These fields take precedence over mapped fields with the same name.
@@ -5248,6 +5297,8 @@ async def search_mvt(
52485297 __query ["human" ] = human
52495298 if pretty is not None :
52505299 __query ["pretty" ] = pretty
5300+ if project_routing is not None :
5301+ __query ["project_routing" ] = project_routing
52515302 if not __body :
52525303 if aggs is not None :
52535304 __body ["aggs" ] = aggs
@@ -5421,6 +5472,7 @@ async def search_template(
54215472 preference : t .Optional [str ] = None ,
54225473 pretty : t .Optional [bool ] = None ,
54235474 profile : t .Optional [bool ] = None ,
5475+ project_routing : t .Optional [str ] = None ,
54245476 rest_total_hits_as_int : t .Optional [bool ] = None ,
54255477 routing : t .Optional [str ] = None ,
54265478 scroll : t .Optional [t .Union [str , t .Literal [- 1 ], t .Literal [0 ]]] = None ,
@@ -5466,6 +5518,10 @@ async def search_template(
54665518 :param preference: The node or shard the operation should be performed on. It
54675519 is random by default.
54685520 :param profile: If `true`, the query execution is profiled.
5521+ :param project_routing: Specifies a subset of projects to target for the search
5522+ using project metadata tags in a subset of Lucene query syntax. Allowed Lucene
5523+ queries: the _alias tag and a single value (possibly wildcarded). Examples:
5524+ _alias:my-project _alias:_origin _alias:*pr* Supported in serverless only.
54695525 :param rest_total_hits_as_int: If `true`, `hits.total` is rendered as an integer
54705526 in the response. If `false`, it is rendered as an object.
54715527 :param routing: A custom value used to route operations to a specific shard.
@@ -5507,6 +5563,8 @@ async def search_template(
55075563 __query ["preference" ] = preference
55085564 if pretty is not None :
55095565 __query ["pretty" ] = pretty
5566+ if project_routing is not None :
5567+ __query ["project_routing" ] = project_routing
55105568 if rest_total_hits_as_int is not None :
55115569 __query ["rest_total_hits_as_int" ] = rest_total_hits_as_int
55125570 if routing is not None :
0 commit comments