mongodb:启用textSearch [英] mongodb: enable textSearch

查看:201
本文介绍了mongodb:启用textSearch的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将在其他已回答的问题中看到,要在MongoDb中启用textserch的beta功能,我必须激活配置文件中的选项.我的问题是在哪里,用哪个命令?

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?

那是因为我的mongodb.conf文件中没有该参数,所以我想我需要添加所有行. 这两种语法中哪一种是正确的?

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

#setParameter=textSearchEnabled=true

在哪里放置命令并不重要?

it's not important where to place the command?

谢谢所有

推荐答案

在MongoDB 2.4中启用Beta文本搜索功能有几个选项:

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

  • 在您的MongoDB配置文件中,其中包含:

  • in your MongoDB configuration file with:

setParameter = textSearchEnabled = true

setParameter=textSearchEnabled=true

启动mongod时通过命令行

  • :

  • via the command-line when you start mongod:

    mongod --setParameter textSearchEnabled=true

    :

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

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

  • 通常首选通过配置文件进行设置,因此您不必记住在重新启动MongoDB时重新启用它.

    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.

    在即将发布的MongoDB 2.6版本中,默认情况下将启用文本搜索功能,并且上述选项将不推荐使用(也是不必要的).

    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).

    这篇关于mongodb:启用textSearch的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆