Skip to content

Commit 467dc51

Browse files
add missing imports
1 parent 4c9294d commit 467dc51

File tree

3 files changed

+44
-4
lines changed

3 files changed

+44
-4
lines changed

elasticsearch/_async/client/esql.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,13 @@
2020
from elastic_transport import ObjectApiResponse
2121

2222
from ._base import NamespacedClient
23-
from .utils import SKIP_IN_PATH, _quote, _rewrite_parameters
23+
from .utils import (
24+
SKIP_IN_PATH,
25+
Stability,
26+
_quote,
27+
_rewrite_parameters,
28+
_stability_warning,
29+
)
2430

2531

2632
class EsqlClient(NamespacedClient):

elasticsearch/_sync/client/esql.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,13 @@
2020
from elastic_transport import ObjectApiResponse
2121

2222
from ._base import NamespacedClient
23-
from .utils import SKIP_IN_PATH, _quote, _rewrite_parameters
23+
from .utils import (
24+
SKIP_IN_PATH,
25+
Stability,
26+
_quote,
27+
_rewrite_parameters,
28+
_stability_warning,
29+
)
2430

2531

2632
class EsqlClient(NamespacedClient):

elasticsearch/dsl/types.py

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,26 @@ def __init__(
144144

145145
class ChunkingSettings(AttrDict[Any]):
146146
"""
147-
:arg strategy: (required) The chunking strategy: `sentence` or `word`.
148-
Defaults to `sentence` if omitted.
147+
:arg strategy: (required) The chunking strategy: `sentence`, `word`,
148+
`none` or `recursive`. * If `strategy` is set to `recursive`,
149+
you must also specify: - `max_chunk_size` - either `separators`
150+
or`separator_group` Learn more about different chunking
151+
strategies in the linked documentation. Defaults to `sentence` if
152+
omitted.
153+
:arg separator_group: (required) This parameter is only applicable
154+
when using the `recursive` chunking strategy. Sets a predefined
155+
list of separators in the saved chunking settings based on the
156+
selected text type. Values can be `markdown` or `plaintext`.
157+
Using this parameter is an alternative to manually specifying a
158+
custom `separators` list.
159+
:arg separators: (required) A list of strings used as possible split
160+
points when chunking text with the `recursive` strategy. Each
161+
string can be a plain string or a regular expression (regex)
162+
pattern. The system tries each separator in order to split the
163+
text, starting from the first item in the list. After splitting,
164+
it attempts to recombine smaller pieces into larger chunks that
165+
stay within the `max_chunk_size` limit, to reduce the total number
166+
of chunks generated.
149167
:arg max_chunk_size: (required) The maximum size of a chunk in words.
150168
This value cannot be higher than `300` or lower than `20` (for
151169
`sentence` strategy) or `10` (for `word` strategy). Defaults to
@@ -160,6 +178,8 @@ class ChunkingSettings(AttrDict[Any]):
160178
"""
161179

162180
strategy: Union[str, DefaultType]
181+
separator_group: Union[str, DefaultType]
182+
separators: Union[Sequence[str], DefaultType]
163183
max_chunk_size: Union[int, DefaultType]
164184
overlap: Union[int, DefaultType]
165185
sentence_overlap: Union[int, DefaultType]
@@ -168,13 +188,19 @@ def __init__(
168188
self,
169189
*,
170190
strategy: Union[str, DefaultType] = DEFAULT,
191+
separator_group: Union[str, DefaultType] = DEFAULT,
192+
separators: Union[Sequence[str], DefaultType] = DEFAULT,
171193
max_chunk_size: Union[int, DefaultType] = DEFAULT,
172194
overlap: Union[int, DefaultType] = DEFAULT,
173195
sentence_overlap: Union[int, DefaultType] = DEFAULT,
174196
**kwargs: Any,
175197
):
176198
if strategy is not DEFAULT:
177199
kwargs["strategy"] = strategy
200+
if separator_group is not DEFAULT:
201+
kwargs["separator_group"] = separator_group
202+
if separators is not DEFAULT:
203+
kwargs["separators"] = separators
178204
if max_chunk_size is not DEFAULT:
179205
kwargs["max_chunk_size"] = max_chunk_size
180206
if overlap is not DEFAULT:
@@ -5198,9 +5224,11 @@ def buckets_as_dict(self) -> Mapping[str, "FiltersBucket"]:
51985224
class FiltersBucket(AttrDict[Any]):
51995225
"""
52005226
:arg doc_count: (required)
5227+
:arg key:
52015228
"""
52025229

52035230
doc_count: int
5231+
key: str
52045232

52055233

52065234
class FrequentItemSetsAggregate(AttrDict[Any]):

0 commit comments

Comments
 (0)