We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e275344 commit 5487df0Copy full SHA for 5487df0
elasticsearch_dsl/field.py
@@ -316,6 +316,10 @@ class Keyword(Field):
316
name = "keyword"
317
318
319
+class ConstantKeyword(Keyword):
320
+ name = "constant_keyword"
321
+
322
323
class Boolean(Field):
324
name = "boolean"
325
_coerce = True
tests/test_field.py
@@ -172,6 +172,11 @@ def test_binary():
172
assert f.deserialize(None) is None
173
174
175
+def test_constant_keyword():
176
+ f = field.ConstantKeyword()
177
+ assert f.to_dict() == {"type": "constant_keyword"}
178
179
180
def test_object_dynamic_values():
181
for dynamic in True, False, "strict":
182
f = field.Object(dynamic=dynamic)
0 commit comments