File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -592,7 +592,7 @@ def __init__(
592
592
self ,
593
593
definition : Mapping [str , Any ],
594
594
name : Optional [str ] = None ,
595
- type : Optional [str ] = "search" ,
595
+ type : Optional [str ] = None ,
596
596
** kwargs : Any ,
597
597
) -> None :
598
598
"""Create a Search Index instance.
@@ -613,7 +613,8 @@ def __init__(
613
613
if name is not None :
614
614
self .__document ["name" ] = name
615
615
self .__document ["definition" ] = definition
616
- self .__document ["type" ] = type
616
+ if type is not None :
617
+ self .__document ["type" ] = type
617
618
self .__document .update (kwargs )
618
619
619
620
@property
Original file line number Diff line number Diff line change @@ -62,7 +62,17 @@ def test_inputs(self):
62
62
listener .reset ()
63
63
with self .assertRaises (OperationFailure ):
64
64
coll .create_search_index ({"definition" : definition , "arbitraryOption" : 1 })
65
- self .assertIn ("arbitraryOption" , listener .events [0 ].command ["indexes" ][0 ])
65
+ self .assertEqual (
66
+ {"definition" : definition , "arbitraryOption" : 1 },
67
+ listener .events [0 ].command ["indexes" ][0 ],
68
+ )
69
+
70
+ listener .reset ()
71
+ with self .assertRaises (OperationFailure ):
72
+ coll .create_search_index ({"definition" : definition , "type" : "search" })
73
+ self .assertEqual (
74
+ {"definition" : definition , "type" : "search" }, listener .events [0 ].command ["indexes" ][0 ]
75
+ )
66
76
67
77
68
78
class SearchIndexIntegrationBase (unittest .TestCase ):
You can’t perform that action at this time.
0 commit comments