Skip to content

Commit d9c30a3

Browse files
safwanrahmanhonzakral
authored andcommitted
adding index in document
1 parent cf9b5a6 commit d9c30a3

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test_elasticsearch_dsl/test_document.py

+15
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ class Comment(document.InnerDoc):
3737
class DocWithNested(document.Document):
3838
comments = field.Nested(Comment)
3939

40+
class Index:
41+
name = 'test-doc-with-nested'
42+
4043
class SimpleCommit(document.Document):
4144
files = field.Text(multi=True)
4245

@@ -59,15 +62,27 @@ def _deserialize(self, data):
5962
class SecretDoc(document.Document):
6063
title = SecretField(index='no')
6164

65+
class Index:
66+
name = 'test-secret-doc'
67+
6268
class NestedSecret(document.Document):
6369
secrets = field.Nested(SecretDoc)
6470

71+
class Index:
72+
name = 'test-nested-secret'
73+
6574
class OptionalObjectWithRequiredField(document.Document):
6675
comments = field.Nested(properties={'title': field.Keyword(required=True)})
6776

77+
class Index:
78+
name = 'test-required'
79+
6880
class Host(document.Document):
6981
ip = field.Ip()
7082

83+
class Index:
84+
name = 'test-host'
85+
7186
def test_range_serializes_properly():
7287
class D(document.Document):
7388
lr = field.LongRange()

0 commit comments

Comments
 (0)