Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-8130

textSearchEnabled:false does not prevent creation of text index on some platforms

    • Windows

      Windows (e.g. ec2-run-instances ami-a442fdcd -t m1.large):

      C:\mongo\mongodb-win32-x86_64-2013-01-09\bin>mongo.exe
      MongoDB shell version: 2.3.2-pre-
      connecting to: test
      Welcome to the MongoDB shell.
      For interactive help, type "help".
      For more comprehensive documentation, see
              http://docs.mongodb.org/
      Questions? Try the support group
              http://groups.google.com/group/mongodb-user
      Server has startup warnings:
      Wed Jan 09 22:03:45.435 [initandlisten]
      Wed Jan 09 22:03:45.436 [initandlisten] ** NOTE: This is a development version (
      2.3.2-pre-) of MongoDB.
      Wed Jan 09 22:03:45.436 [initandlisten] **       Not recommended for production.
      
      Wed Jan 09 22:03:45.436 [initandlisten]
      > db.foo.ensureIndex({a:"text"})
      > db.foo.getIndexes()
      [
              {
                      "v" : 1,
                      "key" : {
                              "_id" : 1
                      },
                      "ns" : "test.foo",
                      "name" : "_id_"
              },
              {
                      "v" : 0,
                      "key" : {
                              "_fts" : "text",
                              "_ftsx" : 1
                      },
                      "ns" : "test.foo",
                      "name" : "a_text",
                      "weights" : {
                              "a" : 1
                      },
                      "default_language" : "english",
                      "language_override" : "language"
              }
      ]
      >
      

      But works as expected on OSX:

      $ mongodb-osx-x86_64-2013-01-09/bin/mongod --fork --logpath /dev/null
      about to fork child process, waiting until server is ready for connections.
      forked process: 41171
      all output going to: /dev/null
      child process started successfully, parent exiting
      $ mongodb-osx-x86_64-2013-01-09/bin/mongo
      MongoDB shell version: 2.3.2-pre-
      connecting to: test
      Server has startup warnings: 
      Wed Jan  9 16:58:40.693 [initandlisten] 
      Wed Jan  9 16:58:40.694 [initandlisten] ** NOTE: This is a development version (2.3.2-pre-) of MongoDB.
      Wed Jan  9 16:58:40.694 [initandlisten] **       Not recommended for production.
      Wed Jan  9 16:58:40.694 [initandlisten] 
      > db.foo.ensureIndex({a:"text"})
      {
      	"err" : "text search not enabled",
      	"code" : 16633,
      	"n" : 0,
      	"connectionId" : 1,
      	"ok" : 1
      }
      >
      

      Culprit, presumably:

               BSONObj FTSIndexPlugin::adjustIndexSpec( const BSONObj& spec ) const {
                   StringData desc  = cc().desc();
                   if ( desc.find( "conn" ) == 0 ) {
                       // this is to make sure we only complain for users
                       // if you do get a text index created an a primary
                       // want it to index on the secondary as well
                       massert( 16633, "text search not enabled", isTextSearchEnabled() );
                   }
                   return FTSSpec::fixSpec( spec );
               }
      

        1. fts_enable_flag.js
          0.5 kB
          J Rassi

            Assignee:
            rassi J Rassi
            Reporter:
            rassi J Rassi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: