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

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions elasticsearch/_async/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -889,6 +889,7 @@ async def count(
min_score: t.Optional[float] = None,
preference: t.Optional[str] = None,
pretty: t.Optional[bool] = None,
project_routing: t.Optional[str] = None,
q: t.Optional[str] = None,
query: t.Optional[t.Mapping[str, t.Any]] = None,
routing: t.Optional[str] = None,
Expand Down Expand Up @@ -943,6 +944,10 @@ async def count(
in the result.
:param preference: The node or shard the operation should be performed on. By
default, it is random.
:param project_routing: Specifies a subset of projects to target for the search
using project metadata tags in a subset of Lucene query syntax. Allowed Lucene
queries: the _alias tag and a single value (possibly wildcarded). Examples:
_alias:my-project _alias:_origin _alias:*pr* Supported in serverless only.
:param q: The query in Lucene query string syntax. This parameter cannot be used
with a request body.
:param query: Defines the search query using Query DSL. A request body query
Expand Down Expand Up @@ -995,6 +1000,8 @@ async def count(
__query["preference"] = preference
if pretty is not None:
__query["pretty"] = pretty
if project_routing is not None:
__query["project_routing"] = project_routing
if q is not None:
__query["q"] = q
if routing is not None:
Expand Down Expand Up @@ -2133,6 +2140,7 @@ async def field_caps(
include_unmapped: t.Optional[bool] = None,
index_filter: t.Optional[t.Mapping[str, t.Any]] = None,
pretty: t.Optional[bool] = None,
project_routing: t.Optional[str] = None,
runtime_mappings: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
types: t.Optional[t.Sequence[str]] = None,
body: t.Optional[t.Dict[str, t.Any]] = None,
Expand Down Expand Up @@ -2176,6 +2184,11 @@ async def field_caps(
deleted documents) are outside of the provided range. However, not all queries
can rewrite to `match_none` so this API may return an index even if the provided
filter matches no document.
:param project_routing: Specifies a subset of projects to target for the field-caps
query using project metadata tags in a subset of Lucene query syntax. Allowed
Lucene queries: the _alias tag and a single value (possibly wildcarded).
Examples: _alias:my-project _alias:_origin _alias:*pr* Supported in serverless
only.
:param runtime_mappings: Define ad-hoc runtime fields in the request similar
to the way it is done in search requests. These fields exist only as part
of the query and take precedence over fields defined with the same name in
Expand Down Expand Up @@ -2213,6 +2226,8 @@ async def field_caps(
__query["include_unmapped"] = include_unmapped
if pretty is not None:
__query["pretty"] = pretty
if project_routing is not None:
__query["project_routing"] = project_routing
if types is not None:
__query["types"] = types
if not __body:
Expand Down Expand Up @@ -3151,6 +3166,7 @@ async def msearch(
max_concurrent_shard_requests: t.Optional[int] = None,
pre_filter_shard_size: t.Optional[int] = None,
pretty: t.Optional[bool] = None,
project_routing: t.Optional[str] = None,
rest_total_hits_as_int: t.Optional[bool] = None,
routing: t.Optional[str] = None,
search_type: t.Optional[
Expand Down Expand Up @@ -3212,6 +3228,10 @@ async def msearch(
roundtrip can limit the number of shards significantly if for instance a
shard can not match any documents based on its rewrite method i.e., if date
filters are mandatory to match but the shard bounds and the query are disjoint.
:param project_routing: 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.
:param rest_total_hits_as_int: If true, hits.total are returned as an integer
in the response. Defaults to false, which returns an object.
:param routing: Custom routing value used to route search operations to a specific
Expand Down Expand Up @@ -3261,6 +3281,8 @@ async def msearch(
__query["pre_filter_shard_size"] = pre_filter_shard_size
if pretty is not None:
__query["pretty"] = pretty
if project_routing is not None:
__query["project_routing"] = project_routing
if rest_total_hits_as_int is not None:
__query["rest_total_hits_as_int"] = rest_total_hits_as_int
if routing is not None:
Expand Down Expand Up @@ -3299,6 +3321,7 @@ async def msearch_template(
human: t.Optional[bool] = None,
max_concurrent_searches: t.Optional[int] = None,
pretty: t.Optional[bool] = None,
project_routing: t.Optional[str] = None,
rest_total_hits_as_int: t.Optional[bool] = None,
search_type: t.Optional[
t.Union[str, t.Literal["dfs_query_then_fetch", "query_then_fetch"]]
Expand Down Expand Up @@ -3332,6 +3355,10 @@ async def msearch_template(
for cross-cluster search requests.
:param max_concurrent_searches: The maximum number of concurrent searches the
API can run.
:param project_routing: Specifies a subset of projects to target for the search
using project metadata tags in a subset of Lucene query syntax. Allowed Lucene
queries: the _alias tag and a single value (possibly wildcarded). Examples:
_alias:my-project _alias:_origin _alias:*pr* Supported in serverless only.
:param rest_total_hits_as_int: If `true`, the response returns `hits.total` as
an integer. If `false`, it returns `hits.total` as an object.
:param search_type: The type of the search operation.
Expand Down Expand Up @@ -3364,6 +3391,8 @@ async def msearch_template(
__query["max_concurrent_searches"] = max_concurrent_searches
if pretty is not None:
__query["pretty"] = pretty
if project_routing is not None:
__query["project_routing"] = project_routing
if rest_total_hits_as_int is not None:
__query["rest_total_hits_as_int"] = rest_total_hits_as_int
if search_type is not None:
Expand Down Expand Up @@ -3534,6 +3563,7 @@ async def open_point_in_time(
max_concurrent_shard_requests: t.Optional[int] = None,
preference: t.Optional[str] = None,
pretty: t.Optional[bool] = None,
project_routing: t.Optional[str] = None,
routing: t.Optional[str] = None,
body: t.Optional[t.Dict[str, t.Any]] = None,
) -> ObjectApiResponse[t.Any]:
Expand Down Expand Up @@ -3590,6 +3620,11 @@ async def open_point_in_time(
that each sub-search request executes per node.
:param preference: The node or shard the operation should be performed on. By
default, it is random.
:param project_routing: Specifies a subset of projects to target for the PIT
request using project metadata tags in a subset of Lucene query syntax. Allowed
Lucene queries: the _alias tag and a single value (possibly wildcarded).
Examples: _alias:my-project _alias:_origin _alias:*pr* Supported in serverless
only.
:param routing: A custom value that is used to route operations to a specific
shard.
"""
Expand Down Expand Up @@ -3621,6 +3656,8 @@ async def open_point_in_time(
__query["preference"] = preference
if pretty is not None:
__query["pretty"] = pretty
if project_routing is not None:
__query["project_routing"] = project_routing
if routing is not None:
__query["routing"] = routing
if not __body:
Expand Down Expand Up @@ -4377,6 +4414,7 @@ async def search(
preference: t.Optional[str] = None,
pretty: t.Optional[bool] = None,
profile: t.Optional[bool] = None,
project_routing: t.Optional[str] = None,
q: t.Optional[str] = None,
query: t.Optional[t.Mapping[str, t.Any]] = None,
rank: t.Optional[t.Mapping[str, t.Any]] = None,
Expand Down Expand Up @@ -4560,6 +4598,10 @@ async def search(
:param profile: Set to `true` to return detailed timing information about the
execution of individual components in a search request. NOTE: This is a debugging
tool and adds significant overhead to search execution.
:param project_routing: Specifies a subset of projects to target for the search
using project metadata tags in a subset of Lucene query syntax. Allowed Lucene
queries: the _alias tag and a single value (possibly wildcarded). Examples:
_alias:my-project _alias:_origin _alias:*pr* Supported in serverless only.
:param q: A query in the Lucene query string syntax. Query parameter searches
do not support the full Elasticsearch Query DSL but are handy for testing.
IMPORTANT: This parameter overrides the query parameter in the request body.
Expand Down Expand Up @@ -4714,6 +4756,8 @@ async def search(
__query["preference"] = preference
if pretty is not None:
__query["pretty"] = pretty
if project_routing is not None:
__query["project_routing"] = project_routing
if q is not None:
__query["q"] = q
if request_cache is not None:
Expand Down Expand Up @@ -4868,6 +4912,7 @@ async def search_mvt(
] = None,
human: t.Optional[bool] = None,
pretty: t.Optional[bool] = None,
project_routing: t.Optional[str] = None,
query: t.Optional[t.Mapping[str, t.Any]] = None,
runtime_mappings: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
size: t.Optional[int] = None,
Expand Down Expand Up @@ -5185,6 +5230,10 @@ async def search_mvt(
In the aggs layer, each feature represents a `geotile_grid` cell. If `grid,
each feature is a polygon of the cells bounding box. If `point`, each feature
is a Point that is the centroid of the cell.
:param project_routing: Specifies a subset of projects to target for the search
using project metadata tags in a subset of Lucene query syntax. Allowed Lucene
queries: the _alias tag and a single value (possibly wildcarded). Examples:
_alias:my-project _alias:_origin _alias:*pr* Supported in serverless only.
:param query: The query DSL used to filter documents for the search.
:param runtime_mappings: Defines one or more runtime fields in the search request.
These fields take precedence over mapped fields with the same name.
Expand Down Expand Up @@ -5248,6 +5297,8 @@ async def search_mvt(
__query["human"] = human
if pretty is not None:
__query["pretty"] = pretty
if project_routing is not None:
__query["project_routing"] = project_routing
if not __body:
if aggs is not None:
__body["aggs"] = aggs
Expand Down Expand Up @@ -5421,6 +5472,7 @@ async def search_template(
preference: t.Optional[str] = None,
pretty: t.Optional[bool] = None,
profile: t.Optional[bool] = None,
project_routing: t.Optional[str] = None,
rest_total_hits_as_int: t.Optional[bool] = None,
routing: t.Optional[str] = None,
scroll: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
Expand Down Expand Up @@ -5466,6 +5518,10 @@ async def search_template(
:param preference: The node or shard the operation should be performed on. It
is random by default.
:param profile: If `true`, the query execution is profiled.
:param project_routing: Specifies a subset of projects to target for the search
using project metadata tags in a subset of Lucene query syntax. Allowed Lucene
queries: the _alias tag and a single value (possibly wildcarded). Examples:
_alias:my-project _alias:_origin _alias:*pr* Supported in serverless only.
:param rest_total_hits_as_int: If `true`, `hits.total` is rendered as an integer
in the response. If `false`, it is rendered as an object.
:param routing: A custom value used to route operations to a specific shard.
Expand Down Expand Up @@ -5507,6 +5563,8 @@ async def search_template(
__query["preference"] = preference
if pretty is not None:
__query["pretty"] = pretty
if project_routing is not None:
__query["project_routing"] = project_routing
if rest_total_hits_as_int is not None:
__query["rest_total_hits_as_int"] = rest_total_hits_as_int
if routing is not None:
Expand Down
7 changes: 7 additions & 0 deletions elasticsearch/_async/client/async_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ async def submit(
preference: t.Optional[str] = None,
pretty: t.Optional[bool] = None,
profile: t.Optional[bool] = None,
project_routing: t.Optional[str] = None,
q: t.Optional[str] = None,
query: t.Optional[t.Mapping[str, t.Any]] = None,
request_cache: t.Optional[bool] = None,
Expand Down Expand Up @@ -408,6 +409,10 @@ async def submit(
:param preference: Specify the node or shard the operation should be performed
on (default: random)
:param profile:
:param project_routing: Specifies a subset of projects to target for the search
using project metadata tags in a subset of Lucene query syntax. Allowed Lucene
queries: the _alias tag and a single value (possibly wildcarded). Examples:
_alias:my-project _alias:_origin _alias:*pr* Supported in serverless only.
:param q: Query in the Lucene query string syntax
:param query: Defines the search definition using the Query DSL.
:param request_cache: Specify if request cache should be used for this request
Expand Down Expand Up @@ -528,6 +533,8 @@ async def submit(
__query["preference"] = preference
if pretty is not None:
__query["pretty"] = pretty
if project_routing is not None:
__query["project_routing"] = project_routing
if q is not None:
__query["q"] = q
if request_cache is not None:
Expand Down
Loading
Loading