Skip to content

Commit

Permalink
[Backport 8.x] Add support for the point field (#1963)
Browse files Browse the repository at this point in the history
* Add support for the point and shape fields (#1959)

* Add support for the point field

* add shape field, remove unnecessary point examples

---------

Co-authored-by: Miguel Grinberg <[email protected]>
(cherry picked from commit c0aa52a)

* Add shape declaration (#1962)

* Add support for the point field

* add shape field, remove unnecessary point examples

* add missing Shape declaration

---------

Co-authored-by: Hüseyin Emre Armağan <[email protected]>

---------

Co-authored-by: Hüseyin Emre Armağan <[email protected]>
Co-authored-by: Miguel Grinberg <[email protected]>
  • Loading branch information
3 people authored Jan 7, 2025
1 parent 185268e commit 9011e0c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions elasticsearch_dsl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,13 @@
Nested,
Object,
Percolator,
Point,
RangeField,
RankFeature,
RankFeatures,
ScaledFloat,
SearchAsYouType,
Shape,
Short,
SparseVector,
Text,
Expand Down Expand Up @@ -169,6 +171,7 @@
"NestedFacet",
"Object",
"Percolator",
"Point",
"Q",
"Query",
"Range",
Expand All @@ -181,6 +184,7 @@
"ScaledFloat",
"Search",
"SearchAsYouType",
"Shape",
"Short",
"SparseVector",
"TermsFacet",
Expand Down
8 changes: 8 additions & 0 deletions elasticsearch_dsl/field.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,14 @@ def _serialize(self, data: Any) -> Optional[str]:
return base64.b64encode(data).decode()


class Point(Field):
name = "point"


class Shape(Field):
name = "shape"


class GeoPoint(Field):
name = "geo_point"

Expand Down

0 comments on commit 9011e0c

Please sign in to comment.