0

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?

JohnnyHK
  • 305,182
  • 66
  • 621
  • 471

1 Answers1

1

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/

mongodb: enable textSearch

Community
  • 1
  • 1
Saheed Hussain
  • 1,096
  • 11
  • 12