File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -273,14 +273,16 @@ def is_mongos(client):
273
273
274
274
275
275
def enable_text_search (client ):
276
- client .admin .command (
277
- 'setParameter' , textSearchEnabled = True )
278
-
279
- for host , port in client .secondaries :
280
- client = MongoClient (host , port )
281
- if client_context .auth_enabled :
282
- client .admin .authenticate (db_user , db_pwd )
283
- client .admin .command ('setParameter' , textSearchEnabled = True )
276
+ sinfo = client .server_info ()
277
+ if 'versionArray' in sinfo and sinfo ['versionArray' ][:2 ] == [2 , 4 ]:
278
+ client .admin .command (
279
+ 'setParameter' , textSearchEnabled = True )
280
+
281
+ for host , port in client .secondaries :
282
+ client = MongoClient (host , port )
283
+ if client_context .auth_enabled :
284
+ client .admin .authenticate (db_user , db_pwd )
285
+ client .admin .command ('setParameter' , textSearchEnabled = True )
284
286
285
287
286
288
def assertRaisesExactly (cls , fn , * args , ** kwargs ):
You can’t perform that action at this time.
0 commit comments