Reputation: 406
I have a production server hosted in mongohq with version 2.4.6. I need to add text index to one of the collections. I tried using the below command from mongo client connecting to my remote server:
db.logs.ensureIndex({title: 'text', description: 'text'})
By default, we cannot add index to production server, since it is restricted by mongohq. But I need to restart the server like below to enable text search:
mongod --setParameter textSearchEnabled=true
But this is possible only for local servers.
Does anyone know how to get this done on remote mongohq server?
Upvotes: 0
Views: 414
Reputation: 1178
Try this in mongoclient "mongo", it should work for you
db.adminCommand( { setParameter : 1, textSearchEnabled : true } )
also check out these links, they may be helpful
http://docs.mongodb.org/v2.4/tutorial/enable-text-search/
Upvotes: 1