[SERVER-8660] setParameter on mongos should enable parameters on all shard members for textSearch Created: 21/Feb/13  Updated: 23/Apr/14  Resolved: 22/Feb/13

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 2.4.0-rc0
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Bernie Hackett Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Operating System: ALL
Participants:

 Description   

Even though I've set textSearchEnabled to true, mongos thinks it's still set to false:

mongos> db.adminCommand({'setParameter': '*', 'textSearchEnabled': true})
{ "was" : true, "ok" : 1 }
mongos> db.test.ensureIndex({'t': 'text'})
{
	"singleShard" : "behackett-dt:37017",
	"err" : "text search not enabled",
	"code" : 16633,
	"n" : 0,
	"connectionId" : 2,
	"ok" : 1
}
 
mongos> db.adminCommand({'setParameter': 1, 'textSearchEnabled': true})
{ "was" : true, "ok" : 1 }
mongos> db.test.ensureIndex({'t': 'text'})
{
	"singleShard" : "behackett-dt:37017",
	"err" : "text search not enabled",
	"code" : 16633,
	"n" : 0,
	"connectionId" : 2,
	"ok" : 1
}
mongos> db.version()
2.4.0-rc0

With a single mongod instance everything works correctly:

MongoDB shell version: 2.4.0-rc0
connecting to: 127.0.0.1:30000/test
>  
> db.adminCommand({'setParameter': '*', 'textSearchEnabled': true})
{ "was" : false, "ok" : 1 }
> db.test.ensureIndex({'t': 'text'})
> db.test.getIndexes()
[
	{
		"v" : 1,
		"key" : {
			"_id" : 1
		},
		"ns" : "test.test",
		"name" : "_id_"
	},
	{
		"v" : 1,
		"key" : {
			"_fts" : "text",
			"_ftsx" : 1
		},
		"ns" : "test.test",
		"name" : "t_text",
		"weights" : {
			"t" : 1
		},
		"default_language" : "english",
		"language_override" : "language",
		"textIndexVersion" : 1
	}
]
> 



 Comments   
Comment by Bernie Hackett [ 22/Feb/13 ]

eliot, we should probably have a warning in the shell to tell you that. This behavior is unexpected.

Comment by Eliot Horowitz (Inactive) [ 22/Feb/13 ]

You have to do it on mongos and every mongod.
See: https://github.com/mongodb/mongo/blob/master/jstests/libs/fts.js#L5

Comment by auto [ 22/Feb/13 ]

Author:

{u'date': u'2013-02-22T00:15:50Z', u'name': u'behackett', u'email': u'bernie@10gen.com'}

Message: Skip text index test on mongos.

setParameter doesn't work through mongos so we
can't actually enable text search. SERVER-8660.
Branch: master
https://github.com/mongodb/mongo-python-driver/commit/4976d28596153de6179e7f0eaa26b984cdbef48e

Generated at Thu Feb 08 03:18:00 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.