Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mongodb: enable textSearch

Tags:

mongodb

I'll see in other answered question that for enable beta feature of textserch in MongoDb i must activate the option in the config file. My question is where and with which command?

That's because i didn't have that parameter in my mongodb.conf file so i suppose i need to add all the line. Which is the correct syntax from these two?

#textSearchEnabled=true

or

#setParameter=textSearchEnabled=true

it's not important where to place the command?

thanks all

like image 521
Andrea_86 Avatar asked Dec 18 '13 21:12

Andrea_86


1 Answers

There are several options for enabling the beta text search feature in MongoDB 2.4:

  • in your MongoDB configuration file with:

    setParameter=textSearchEnabled=true

  • via the command-line when you start mongod:

    mongod --setParameter textSearchEnabled=true

  • via the mongo shell:

    db.adminCommand( { setParameter: true, textSearchEnabled : true})

Setting via a config file is typically the preferred option, so you don't have to remember to re-enable this when you restart your MongoDB.

In the upcoming MongoDB 2.6 release the text search feature will be enabled by default and the above options will be deprecated (and unnecessary).

like image 170
Stennie Avatar answered Sep 23 '22 04:09

Stennie