elasticsearch 8.19.2__py3-none-any.whl → 8.19.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- elasticsearch/_async/client/__init__.py +39 -18
- elasticsearch/_async/client/async_search.py +3 -3
- elasticsearch/_async/client/autoscaling.py +8 -4
- elasticsearch/_async/client/cat.py +40 -2
- elasticsearch/_async/client/ccr.py +2 -2
- elasticsearch/_async/client/cluster.py +10 -9
- elasticsearch/_async/client/connector.py +34 -33
- elasticsearch/_async/client/dangling_indices.py +6 -10
- elasticsearch/_async/client/eql.py +2 -2
- elasticsearch/_async/client/esql.py +1 -1
- elasticsearch/_async/client/features.py +2 -2
- elasticsearch/_async/client/fleet.py +3 -3
- elasticsearch/_async/client/indices.py +235 -25
- elasticsearch/_async/client/ingest.py +1 -1
- elasticsearch/_async/client/license.py +3 -5
- elasticsearch/_async/client/ml.py +61 -21
- elasticsearch/_async/client/monitoring.py +2 -1
- elasticsearch/_async/client/nodes.py +7 -7
- elasticsearch/_async/client/rollup.py +9 -9
- elasticsearch/_async/client/search_application.py +11 -11
- elasticsearch/_async/client/searchable_snapshots.py +4 -4
- elasticsearch/_async/client/security.py +4 -4
- elasticsearch/_async/client/shutdown.py +7 -2
- elasticsearch/_async/client/simulate.py +2 -2
- elasticsearch/_async/client/slm.py +1 -1
- elasticsearch/_async/client/snapshot.py +3 -2
- elasticsearch/_async/client/streams.py +6 -6
- elasticsearch/_async/client/tasks.py +4 -4
- elasticsearch/_async/client/text_structure.py +5 -1
- elasticsearch/_async/client/transform.py +37 -0
- elasticsearch/_async/client/utils.py +4 -2
- elasticsearch/_async/client/watcher.py +2 -2
- elasticsearch/_async/client/xpack.py +2 -1
- elasticsearch/_sync/client/__init__.py +41 -18
- elasticsearch/_sync/client/async_search.py +3 -3
- elasticsearch/_sync/client/autoscaling.py +8 -4
- elasticsearch/_sync/client/cat.py +40 -2
- elasticsearch/_sync/client/ccr.py +2 -2
- elasticsearch/_sync/client/cluster.py +10 -9
- elasticsearch/_sync/client/connector.py +34 -33
- elasticsearch/_sync/client/dangling_indices.py +6 -10
- elasticsearch/_sync/client/eql.py +2 -2
- elasticsearch/_sync/client/esql.py +1 -1
- elasticsearch/_sync/client/features.py +2 -2
- elasticsearch/_sync/client/fleet.py +3 -3
- elasticsearch/_sync/client/indices.py +235 -25
- elasticsearch/_sync/client/ingest.py +1 -1
- elasticsearch/_sync/client/license.py +3 -5
- elasticsearch/_sync/client/ml.py +61 -21
- elasticsearch/_sync/client/monitoring.py +2 -1
- elasticsearch/_sync/client/nodes.py +7 -7
- elasticsearch/_sync/client/rollup.py +9 -9
- elasticsearch/_sync/client/search_application.py +11 -11
- elasticsearch/_sync/client/searchable_snapshots.py +4 -4
- elasticsearch/_sync/client/security.py +4 -4
- elasticsearch/_sync/client/shutdown.py +7 -2
- elasticsearch/_sync/client/simulate.py +2 -2
- elasticsearch/_sync/client/slm.py +1 -1
- elasticsearch/_sync/client/snapshot.py +3 -2
- elasticsearch/_sync/client/streams.py +6 -6
- elasticsearch/_sync/client/tasks.py +4 -4
- elasticsearch/_sync/client/text_structure.py +5 -1
- elasticsearch/_sync/client/transform.py +37 -0
- elasticsearch/_sync/client/utils.py +16 -2
- elasticsearch/_sync/client/watcher.py +2 -2
- elasticsearch/_sync/client/xpack.py +2 -1
- elasticsearch/_version.py +2 -2
- elasticsearch/dsl/_async/document.py +4 -5
- elasticsearch/dsl/_async/index.py +1 -1
- elasticsearch/dsl/_async/search.py +2 -3
- elasticsearch/dsl/_sync/document.py +4 -5
- elasticsearch/dsl/_sync/index.py +1 -1
- elasticsearch/dsl/_sync/search.py +2 -3
- elasticsearch/dsl/aggs.py +7 -7
- elasticsearch/dsl/async_connections.py +1 -2
- elasticsearch/dsl/connections.py +1 -2
- elasticsearch/dsl/document_base.py +1 -1
- elasticsearch/dsl/query.py +23 -0
- elasticsearch/dsl/serializer.py +1 -2
- elasticsearch/dsl/types.py +2 -0
- elasticsearch/dsl/utils.py +1 -2
- elasticsearch/esql/esql.py +1 -1
- elasticsearch/esql/functions.py +2 -2
- elasticsearch/helpers/vectorstore/__init__.py +7 -7
- elasticsearch/helpers/vectorstore/_async/_utils.py +1 -1
- elasticsearch/helpers/vectorstore/_async/embedding_service.py +2 -2
- elasticsearch/helpers/vectorstore/_async/strategies.py +3 -3
- elasticsearch/helpers/vectorstore/_async/vectorstore.py +5 -5
- elasticsearch/helpers/vectorstore/_sync/_utils.py +1 -1
- elasticsearch/helpers/vectorstore/_sync/embedding_service.py +2 -2
- elasticsearch/helpers/vectorstore/_sync/strategies.py +3 -3
- elasticsearch/helpers/vectorstore/_sync/vectorstore.py +5 -5
- {elasticsearch-8.19.2.dist-info → elasticsearch-8.19.3.dist-info}/METADATA +1 -1
- elasticsearch-8.19.3.dist-info/RECORD +166 -0
- {elasticsearch-8.19.2.dist-info → elasticsearch-8.19.3.dist-info}/WHEEL +1 -1
- elasticsearch-8.19.2.dist-info/RECORD +0 -166
- {elasticsearch-8.19.2.dist-info → elasticsearch-8.19.3.dist-info}/licenses/LICENSE +0 -0
- {elasticsearch-8.19.2.dist-info → elasticsearch-8.19.3.dist-info}/licenses/NOTICE +0 -0
|
@@ -31,9 +31,8 @@ from typing import (
|
|
|
31
31
|
|
|
32
32
|
from typing_extensions import Self, dataclass_transform
|
|
33
33
|
|
|
34
|
-
from
|
|
35
|
-
from
|
|
36
|
-
|
|
34
|
+
from ...exceptions import NotFoundError, RequestError
|
|
35
|
+
from ...helpers import bulk
|
|
37
36
|
from .._sync.index import Index
|
|
38
37
|
from ..connections import get_connection
|
|
39
38
|
from ..document_base import DocumentBase, DocumentMeta, mapped_field
|
|
@@ -42,8 +41,8 @@ from ..utils import DOC_META_FIELDS, META_FIELDS, UsingType, merge
|
|
|
42
41
|
from .search import Search
|
|
43
42
|
|
|
44
43
|
if TYPE_CHECKING:
|
|
45
|
-
from
|
|
46
|
-
from
|
|
44
|
+
from ... import Elasticsearch
|
|
45
|
+
from ...esql.esql import ESQLBase
|
|
47
46
|
|
|
48
47
|
|
|
49
48
|
class IndexMeta(DocumentMeta):
|
elasticsearch/dsl/_sync/index.py
CHANGED
|
@@ -28,9 +28,8 @@ from typing import (
|
|
|
28
28
|
|
|
29
29
|
from typing_extensions import Self
|
|
30
30
|
|
|
31
|
-
from
|
|
32
|
-
from
|
|
33
|
-
|
|
31
|
+
from ...exceptions import ApiError
|
|
32
|
+
from ...helpers import scan
|
|
34
33
|
from ..connections import get_connection
|
|
35
34
|
from ..response import Response
|
|
36
35
|
from ..search_base import MultiSearchBase, SearchBase
|
elasticsearch/dsl/aggs.py
CHANGED
|
@@ -1513,9 +1513,9 @@ class GeoLine(Agg[_R]):
|
|
|
1513
1513
|
ordered by the chosen sort field.
|
|
1514
1514
|
|
|
1515
1515
|
:arg point: (required) The name of the geo_point field.
|
|
1516
|
-
:arg sort:
|
|
1517
|
-
|
|
1518
|
-
|
|
1516
|
+
:arg sort: The name of the numeric field to use as the sort key for
|
|
1517
|
+
ordering the points. When the `geo_line` aggregation is nested
|
|
1518
|
+
inside a `time_series` aggregation, this field defaults to
|
|
1519
1519
|
`@timestamp`, and any other value will result in error.
|
|
1520
1520
|
:arg include_sort: When `true`, returns an additional array of the
|
|
1521
1521
|
sort values in the feature properties.
|
|
@@ -1852,9 +1852,9 @@ class Inference(Pipeline[_R]):
|
|
|
1852
1852
|
class Line(Agg[_R]):
|
|
1853
1853
|
"""
|
|
1854
1854
|
:arg point: (required) The name of the geo_point field.
|
|
1855
|
-
:arg sort:
|
|
1856
|
-
|
|
1857
|
-
|
|
1855
|
+
:arg sort: The name of the numeric field to use as the sort key for
|
|
1856
|
+
ordering the points. When the `geo_line` aggregation is nested
|
|
1857
|
+
inside a `time_series` aggregation, this field defaults to
|
|
1858
1858
|
`@timestamp`, and any other value will result in error.
|
|
1859
1859
|
:arg include_sort: When `true`, returns an additional array of the
|
|
1860
1860
|
sort values in the feature properties.
|
|
@@ -2677,7 +2677,7 @@ class Percentiles(Agg[_R]):
|
|
|
2677
2677
|
self,
|
|
2678
2678
|
*,
|
|
2679
2679
|
keyed: Union[bool, "DefaultType"] = DEFAULT,
|
|
2680
|
-
percents: Union[Sequence[float], "DefaultType"] = DEFAULT,
|
|
2680
|
+
percents: Union[float, Sequence[float], "DefaultType"] = DEFAULT,
|
|
2681
2681
|
hdr: Union["types.HdrMethod", Dict[str, Any], "DefaultType"] = DEFAULT,
|
|
2682
2682
|
tdigest: Union["types.TDigest", Dict[str, Any], "DefaultType"] = DEFAULT,
|
|
2683
2683
|
format: Union[str, "DefaultType"] = DEFAULT,
|
elasticsearch/dsl/connections.py
CHANGED
elasticsearch/dsl/query.py
CHANGED
|
@@ -370,6 +370,7 @@ class Common(Query):
|
|
|
370
370
|
_value: Union[
|
|
371
371
|
"types.CommonTermsQuery", Dict[str, Any], "DefaultType"
|
|
372
372
|
] = DEFAULT,
|
|
373
|
+
/,
|
|
373
374
|
**kwargs: Any,
|
|
374
375
|
):
|
|
375
376
|
if _field is not DEFAULT:
|
|
@@ -666,6 +667,7 @@ class Fuzzy(Query):
|
|
|
666
667
|
self,
|
|
667
668
|
_field: Union[str, "InstrumentedField", "DefaultType"] = DEFAULT,
|
|
668
669
|
_value: Union["types.FuzzyQuery", Dict[str, Any], "DefaultType"] = DEFAULT,
|
|
670
|
+
/,
|
|
669
671
|
**kwargs: Any,
|
|
670
672
|
):
|
|
671
673
|
if _field is not DEFAULT:
|
|
@@ -708,6 +710,7 @@ class GeoBoundingBox(Query):
|
|
|
708
710
|
Dict[str, Any],
|
|
709
711
|
"DefaultType",
|
|
710
712
|
] = DEFAULT,
|
|
713
|
+
/,
|
|
711
714
|
*,
|
|
712
715
|
type: Union[Literal["memory", "indexed"], "DefaultType"] = DEFAULT,
|
|
713
716
|
validation_method: Union[
|
|
@@ -771,6 +774,7 @@ class GeoDistance(Query):
|
|
|
771
774
|
Dict[str, Any],
|
|
772
775
|
"DefaultType",
|
|
773
776
|
] = DEFAULT,
|
|
777
|
+
/,
|
|
774
778
|
*,
|
|
775
779
|
distance: Union[str, "DefaultType"] = DEFAULT,
|
|
776
780
|
distance_type: Union[Literal["arc", "plane"], "DefaultType"] = DEFAULT,
|
|
@@ -810,6 +814,7 @@ class GeoGrid(Query):
|
|
|
810
814
|
self,
|
|
811
815
|
_field: Union[str, "InstrumentedField", "DefaultType"] = DEFAULT,
|
|
812
816
|
_value: Union["types.GeoGridQuery", Dict[str, Any], "DefaultType"] = DEFAULT,
|
|
817
|
+
/,
|
|
813
818
|
**kwargs: Any,
|
|
814
819
|
):
|
|
815
820
|
if _field is not DEFAULT:
|
|
@@ -839,6 +844,7 @@ class GeoPolygon(Query):
|
|
|
839
844
|
_value: Union[
|
|
840
845
|
"types.GeoPolygonPoints", Dict[str, Any], "DefaultType"
|
|
841
846
|
] = DEFAULT,
|
|
847
|
+
/,
|
|
842
848
|
*,
|
|
843
849
|
validation_method: Union[
|
|
844
850
|
Literal["coerce", "ignore_malformed", "strict"], "DefaultType"
|
|
@@ -885,6 +891,7 @@ class GeoShape(Query):
|
|
|
885
891
|
_value: Union[
|
|
886
892
|
"types.GeoShapeFieldQuery", Dict[str, Any], "DefaultType"
|
|
887
893
|
] = DEFAULT,
|
|
894
|
+
/,
|
|
888
895
|
*,
|
|
889
896
|
ignore_unmapped: Union[bool, "DefaultType"] = DEFAULT,
|
|
890
897
|
boost: Union[float, "DefaultType"] = DEFAULT,
|
|
@@ -1060,6 +1067,7 @@ class Intervals(Query):
|
|
|
1060
1067
|
self,
|
|
1061
1068
|
_field: Union[str, "InstrumentedField", "DefaultType"] = DEFAULT,
|
|
1062
1069
|
_value: Union["types.IntervalsQuery", Dict[str, Any], "DefaultType"] = DEFAULT,
|
|
1070
|
+
/,
|
|
1063
1071
|
**kwargs: Any,
|
|
1064
1072
|
):
|
|
1065
1073
|
if _field is not DEFAULT:
|
|
@@ -1147,6 +1155,7 @@ class Match(Query):
|
|
|
1147
1155
|
self,
|
|
1148
1156
|
_field: Union[str, "InstrumentedField", "DefaultType"] = DEFAULT,
|
|
1149
1157
|
_value: Union["types.MatchQuery", Dict[str, Any], "DefaultType"] = DEFAULT,
|
|
1158
|
+
/,
|
|
1150
1159
|
**kwargs: Any,
|
|
1151
1160
|
):
|
|
1152
1161
|
if _field is not DEFAULT:
|
|
@@ -1212,6 +1221,7 @@ class MatchBoolPrefix(Query):
|
|
|
1212
1221
|
_value: Union[
|
|
1213
1222
|
"types.MatchBoolPrefixQuery", Dict[str, Any], "DefaultType"
|
|
1214
1223
|
] = DEFAULT,
|
|
1224
|
+
/,
|
|
1215
1225
|
**kwargs: Any,
|
|
1216
1226
|
):
|
|
1217
1227
|
if _field is not DEFAULT:
|
|
@@ -1272,6 +1282,7 @@ class MatchPhrase(Query):
|
|
|
1272
1282
|
_value: Union[
|
|
1273
1283
|
"types.MatchPhraseQuery", Dict[str, Any], "DefaultType"
|
|
1274
1284
|
] = DEFAULT,
|
|
1285
|
+
/,
|
|
1275
1286
|
**kwargs: Any,
|
|
1276
1287
|
):
|
|
1277
1288
|
if _field is not DEFAULT:
|
|
@@ -1297,6 +1308,7 @@ class MatchPhrasePrefix(Query):
|
|
|
1297
1308
|
_value: Union[
|
|
1298
1309
|
"types.MatchPhrasePrefixQuery", Dict[str, Any], "DefaultType"
|
|
1299
1310
|
] = DEFAULT,
|
|
1311
|
+
/,
|
|
1300
1312
|
**kwargs: Any,
|
|
1301
1313
|
):
|
|
1302
1314
|
if _field is not DEFAULT:
|
|
@@ -1780,6 +1792,7 @@ class Prefix(Query):
|
|
|
1780
1792
|
self,
|
|
1781
1793
|
_field: Union[str, "InstrumentedField", "DefaultType"] = DEFAULT,
|
|
1782
1794
|
_value: Union["types.PrefixQuery", Dict[str, Any], "DefaultType"] = DEFAULT,
|
|
1795
|
+
/,
|
|
1783
1796
|
**kwargs: Any,
|
|
1784
1797
|
):
|
|
1785
1798
|
if _field is not DEFAULT:
|
|
@@ -1946,6 +1959,7 @@ class Range(Query):
|
|
|
1946
1959
|
self,
|
|
1947
1960
|
_field: Union[str, "InstrumentedField", "DefaultType"] = DEFAULT,
|
|
1948
1961
|
_value: Union["wrappers.Range[Any]", Dict[str, Any], "DefaultType"] = DEFAULT,
|
|
1962
|
+
/,
|
|
1949
1963
|
**kwargs: Any,
|
|
1950
1964
|
):
|
|
1951
1965
|
if _field is not DEFAULT:
|
|
@@ -2024,6 +2038,7 @@ class Regexp(Query):
|
|
|
2024
2038
|
self,
|
|
2025
2039
|
_field: Union[str, "InstrumentedField", "DefaultType"] = DEFAULT,
|
|
2026
2040
|
_value: Union["types.RegexpQuery", Dict[str, Any], "DefaultType"] = DEFAULT,
|
|
2041
|
+
/,
|
|
2027
2042
|
**kwargs: Any,
|
|
2028
2043
|
):
|
|
2029
2044
|
if _field is not DEFAULT:
|
|
@@ -2194,6 +2209,7 @@ class Shape(Query):
|
|
|
2194
2209
|
self,
|
|
2195
2210
|
_field: Union[str, "InstrumentedField", "DefaultType"] = DEFAULT,
|
|
2196
2211
|
_value: Union["types.ShapeFieldQuery", Dict[str, Any], "DefaultType"] = DEFAULT,
|
|
2212
|
+
/,
|
|
2197
2213
|
*,
|
|
2198
2214
|
ignore_unmapped: Union[bool, "DefaultType"] = DEFAULT,
|
|
2199
2215
|
boost: Union[float, "DefaultType"] = DEFAULT,
|
|
@@ -2552,6 +2568,7 @@ class SpanTerm(Query):
|
|
|
2552
2568
|
self,
|
|
2553
2569
|
_field: Union[str, "InstrumentedField", "DefaultType"] = DEFAULT,
|
|
2554
2570
|
_value: Union["types.SpanTermQuery", Dict[str, Any], "DefaultType"] = DEFAULT,
|
|
2571
|
+
/,
|
|
2555
2572
|
**kwargs: Any,
|
|
2556
2573
|
):
|
|
2557
2574
|
if _field is not DEFAULT:
|
|
@@ -2672,6 +2689,7 @@ class Term(Query):
|
|
|
2672
2689
|
self,
|
|
2673
2690
|
_field: Union[str, "InstrumentedField", "DefaultType"] = DEFAULT,
|
|
2674
2691
|
_value: Union["types.TermQuery", Dict[str, Any], "DefaultType"] = DEFAULT,
|
|
2692
|
+
/,
|
|
2675
2693
|
**kwargs: Any,
|
|
2676
2694
|
):
|
|
2677
2695
|
if _field is not DEFAULT:
|
|
@@ -2706,6 +2724,7 @@ class Terms(Query):
|
|
|
2706
2724
|
Dict[str, Any],
|
|
2707
2725
|
"DefaultType",
|
|
2708
2726
|
] = DEFAULT,
|
|
2727
|
+
/,
|
|
2709
2728
|
*,
|
|
2710
2729
|
boost: Union[float, "DefaultType"] = DEFAULT,
|
|
2711
2730
|
_name: Union[str, "DefaultType"] = DEFAULT,
|
|
@@ -2739,6 +2758,7 @@ class TermsSet(Query):
|
|
|
2739
2758
|
self,
|
|
2740
2759
|
_field: Union[str, "InstrumentedField", "DefaultType"] = DEFAULT,
|
|
2741
2760
|
_value: Union["types.TermsSetQuery", Dict[str, Any], "DefaultType"] = DEFAULT,
|
|
2761
|
+
/,
|
|
2742
2762
|
**kwargs: Any,
|
|
2743
2763
|
):
|
|
2744
2764
|
if _field is not DEFAULT:
|
|
@@ -2764,6 +2784,7 @@ class TextExpansion(Query):
|
|
|
2764
2784
|
_value: Union[
|
|
2765
2785
|
"types.TextExpansionQuery", Dict[str, Any], "DefaultType"
|
|
2766
2786
|
] = DEFAULT,
|
|
2787
|
+
/,
|
|
2767
2788
|
**kwargs: Any,
|
|
2768
2789
|
):
|
|
2769
2790
|
if _field is not DEFAULT:
|
|
@@ -2788,6 +2809,7 @@ class WeightedTokens(Query):
|
|
|
2788
2809
|
_value: Union[
|
|
2789
2810
|
"types.WeightedTokensQuery", Dict[str, Any], "DefaultType"
|
|
2790
2811
|
] = DEFAULT,
|
|
2812
|
+
/,
|
|
2791
2813
|
**kwargs: Any,
|
|
2792
2814
|
):
|
|
2793
2815
|
if _field is not DEFAULT:
|
|
@@ -2809,6 +2831,7 @@ class Wildcard(Query):
|
|
|
2809
2831
|
self,
|
|
2810
2832
|
_field: Union[str, "InstrumentedField", "DefaultType"] = DEFAULT,
|
|
2811
2833
|
_value: Union["types.WildcardQuery", Dict[str, Any], "DefaultType"] = DEFAULT,
|
|
2834
|
+
/,
|
|
2812
2835
|
**kwargs: Any,
|
|
2813
2836
|
):
|
|
2814
2837
|
if _field is not DEFAULT:
|
elasticsearch/dsl/serializer.py
CHANGED
elasticsearch/dsl/types.py
CHANGED
|
@@ -937,6 +937,7 @@ class GeoDistanceSort(AttrDict[Any]):
|
|
|
937
937
|
Dict[str, Any],
|
|
938
938
|
"DefaultType",
|
|
939
939
|
] = DEFAULT,
|
|
940
|
+
/,
|
|
940
941
|
*,
|
|
941
942
|
mode: Union[
|
|
942
943
|
Literal["min", "max", "sum", "avg", "median"], DefaultType
|
|
@@ -3259,6 +3260,7 @@ class SortOptions(AttrDict[Any]):
|
|
|
3259
3260
|
self,
|
|
3260
3261
|
_field: Union[str, "InstrumentedField", "DefaultType"] = DEFAULT,
|
|
3261
3262
|
_value: Union["FieldSort", Dict[str, Any], "DefaultType"] = DEFAULT,
|
|
3263
|
+
/,
|
|
3262
3264
|
*,
|
|
3263
3265
|
_score: Union["ScoreSort", Dict[str, Any], DefaultType] = DEFAULT,
|
|
3264
3266
|
_doc: Union["ScoreSort", Dict[str, Any], DefaultType] = DEFAULT,
|
elasticsearch/dsl/utils.py
CHANGED
|
@@ -44,8 +44,7 @@ from .exceptions import UnknownDslObject, ValidationException
|
|
|
44
44
|
if TYPE_CHECKING:
|
|
45
45
|
from elastic_transport import ObjectApiResponse
|
|
46
46
|
|
|
47
|
-
from
|
|
48
|
-
|
|
47
|
+
from .. import AsyncElasticsearch, Elasticsearch
|
|
49
48
|
from .document_base import DocumentOptions
|
|
50
49
|
from .field import Field
|
|
51
50
|
from .index_base import IndexBase
|
elasticsearch/esql/esql.py
CHANGED
elasticsearch/esql/functions.py
CHANGED
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
import json
|
|
19
19
|
from typing import Any
|
|
20
20
|
|
|
21
|
-
from
|
|
22
|
-
from
|
|
21
|
+
from ..dsl.document_base import InstrumentedExpression
|
|
22
|
+
from ..esql.esql import ESQLBase, ExpressionType
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
def _render(v: Any) -> str:
|
|
@@ -15,31 +15,31 @@
|
|
|
15
15
|
# specific language governing permissions and limitations
|
|
16
16
|
# under the License.
|
|
17
17
|
|
|
18
|
-
from
|
|
18
|
+
from ...helpers.vectorstore._async.embedding_service import (
|
|
19
19
|
AsyncElasticsearchEmbeddings,
|
|
20
20
|
AsyncEmbeddingService,
|
|
21
21
|
)
|
|
22
|
-
from
|
|
22
|
+
from ...helpers.vectorstore._async.strategies import (
|
|
23
23
|
AsyncBM25Strategy,
|
|
24
24
|
AsyncDenseVectorScriptScoreStrategy,
|
|
25
25
|
AsyncDenseVectorStrategy,
|
|
26
26
|
AsyncRetrievalStrategy,
|
|
27
27
|
AsyncSparseVectorStrategy,
|
|
28
28
|
)
|
|
29
|
-
from
|
|
30
|
-
from
|
|
29
|
+
from ...helpers.vectorstore._async.vectorstore import AsyncVectorStore
|
|
30
|
+
from ...helpers.vectorstore._sync.embedding_service import (
|
|
31
31
|
ElasticsearchEmbeddings,
|
|
32
32
|
EmbeddingService,
|
|
33
33
|
)
|
|
34
|
-
from
|
|
34
|
+
from ...helpers.vectorstore._sync.strategies import (
|
|
35
35
|
BM25Strategy,
|
|
36
36
|
DenseVectorScriptScoreStrategy,
|
|
37
37
|
DenseVectorStrategy,
|
|
38
38
|
RetrievalStrategy,
|
|
39
39
|
SparseVectorStrategy,
|
|
40
40
|
)
|
|
41
|
-
from
|
|
42
|
-
from
|
|
41
|
+
from ...helpers.vectorstore._sync.vectorstore import VectorStore
|
|
42
|
+
from ...helpers.vectorstore._utils import DistanceMetric
|
|
43
43
|
|
|
44
44
|
__all__ = [
|
|
45
45
|
"AsyncBM25Strategy",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
# specific language governing permissions and limitations
|
|
16
16
|
# under the License.
|
|
17
17
|
|
|
18
|
-
from
|
|
18
|
+
from .... import AsyncElasticsearch, BadRequestError, NotFoundError
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
async def model_must_be_deployed(client: AsyncElasticsearch, model_id: str) -> None:
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
from abc import ABC, abstractmethod
|
|
19
19
|
from typing import List
|
|
20
20
|
|
|
21
|
-
from
|
|
22
|
-
from
|
|
21
|
+
from .... import AsyncElasticsearch
|
|
22
|
+
from ...._version import __versionstr__ as lib_version
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
class AsyncEmbeddingService(ABC):
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
from abc import ABC, abstractmethod
|
|
19
19
|
from typing import Any, Dict, List, Optional, Tuple, Union, cast
|
|
20
20
|
|
|
21
|
-
from
|
|
22
|
-
from
|
|
23
|
-
from
|
|
21
|
+
from .... import AsyncElasticsearch
|
|
22
|
+
from ....helpers.vectorstore._async._utils import model_must_be_deployed
|
|
23
|
+
from ....helpers.vectorstore._utils import DistanceMetric
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
class AsyncRetrievalStrategy(ABC):
|
|
@@ -19,14 +19,14 @@ import logging
|
|
|
19
19
|
import uuid
|
|
20
20
|
from typing import Any, Callable, Dict, List, Optional
|
|
21
21
|
|
|
22
|
-
from
|
|
23
|
-
from
|
|
24
|
-
from
|
|
25
|
-
from
|
|
22
|
+
from .... import AsyncElasticsearch
|
|
23
|
+
from ...._version import __versionstr__ as lib_version
|
|
24
|
+
from ....helpers import BulkIndexError, async_bulk
|
|
25
|
+
from ....helpers.vectorstore import (
|
|
26
26
|
AsyncEmbeddingService,
|
|
27
27
|
AsyncRetrievalStrategy,
|
|
28
28
|
)
|
|
29
|
-
from
|
|
29
|
+
from ....helpers.vectorstore._utils import maximal_marginal_relevance
|
|
30
30
|
|
|
31
31
|
logger = logging.getLogger(__name__)
|
|
32
32
|
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
# specific language governing permissions and limitations
|
|
16
16
|
# under the License.
|
|
17
17
|
|
|
18
|
-
from
|
|
18
|
+
from .... import BadRequestError, Elasticsearch, NotFoundError
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
def model_must_be_deployed(client: Elasticsearch, model_id: str) -> None:
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
from abc import ABC, abstractmethod
|
|
19
19
|
from typing import List
|
|
20
20
|
|
|
21
|
-
from
|
|
22
|
-
from
|
|
21
|
+
from .... import Elasticsearch
|
|
22
|
+
from ...._version import __versionstr__ as lib_version
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
class EmbeddingService(ABC):
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
from abc import ABC, abstractmethod
|
|
19
19
|
from typing import Any, Dict, List, Optional, Tuple, Union, cast
|
|
20
20
|
|
|
21
|
-
from
|
|
22
|
-
from
|
|
23
|
-
from
|
|
21
|
+
from .... import Elasticsearch
|
|
22
|
+
from ....helpers.vectorstore._sync._utils import model_must_be_deployed
|
|
23
|
+
from ....helpers.vectorstore._utils import DistanceMetric
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
class RetrievalStrategy(ABC):
|
|
@@ -19,14 +19,14 @@ import logging
|
|
|
19
19
|
import uuid
|
|
20
20
|
from typing import Any, Callable, Dict, List, Optional
|
|
21
21
|
|
|
22
|
-
from
|
|
23
|
-
from
|
|
24
|
-
from
|
|
25
|
-
from
|
|
22
|
+
from .... import Elasticsearch
|
|
23
|
+
from ...._version import __versionstr__ as lib_version
|
|
24
|
+
from ....helpers import BulkIndexError, bulk
|
|
25
|
+
from ....helpers.vectorstore import (
|
|
26
26
|
EmbeddingService,
|
|
27
27
|
RetrievalStrategy,
|
|
28
28
|
)
|
|
29
|
-
from
|
|
29
|
+
from ....helpers.vectorstore._utils import maximal_marginal_relevance
|
|
30
30
|
|
|
31
31
|
logger = logging.getLogger(__name__)
|
|
32
32
|
|