File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -144,13 +144,15 @@ def is_mongos(client):
144144 return res .get ('msg' , '' ) == 'isdbgrid'
145145
146146def enable_text_search (client ):
147- client .admin .command (
148- 'setParameter' , textSearchEnabled = True )
149-
150- if isinstance (client , MongoReplicaSetClient ):
151- for host , port in client .secondaries :
152- MongoClient (host , port ).admin .command (
153- 'setParameter' , textSearchEnabled = True )
147+ sinfo = client .server_info ()
148+ if 'versionArray' in sinfo and sinfo ['versionArray' ][:2 ] == [2 , 4 ]:
149+ client .admin .command (
150+ 'setParameter' , textSearchEnabled = True )
151+
152+ if isinstance (client , MongoReplicaSetClient ):
153+ for host , port in client .secondaries :
154+ MongoClient (host , port ).admin .command (
155+ 'setParameter' , textSearchEnabled = True )
154156
155157def assertRaisesExactly (cls , fn , * args , ** kwargs ):
156158 """
You can’t perform that action at this time.
0 commit comments