title: Full Text Search in MongoDB/Node.js-mongoose-text-search
body: <p>I am trying to perform full text search on MongoDB and Node.js using the mongoose-text-search plugin.  I am following the example code from <a href="https://github.com/aheckmann/mongoose-text-search" rel="nofollow noreferrer">https://github.com/aheckmann/mongoose-text-search</a> and my code is shown below.  I keep getting an error stating: 
  "Error: text search not enabled.
   undefined"
  I followed the directions from <a href="https://stackoverflow.com/questions/16513040/installing-plugins-for-mongoose-getting-error">Installing plugins for mongoose - getting error</a>, which led me to the MongoDB site:  <a href="http://docs.mongodb.org/manual/tutorial/enable-text-search" rel="nofollow noreferrer">http://docs.mongodb.org/manual/tutorial/enable-text-search</a>.
  However, after I enable text search by typing the command:</p>
  
  <p>mongod --setParameter textSearchEnabled=true</p>
  
  <p>in terminal, I start my application and encounter an additional error.  It states: 
  "MongoError: E11000 duplicate key error index: meddb.tweets.$id_1  dup key: { : null }
  This is error: Error: text search not enabled
  undefined"</p>
  
  <p>If any of you have encountered this error and found a way around it , please let me know what I am missing or need to change.</p>
  
  <pre><code>var mongoose = require('mongoose');
  var textSearch = require('mongoose-text-search');
  var Schema = mongoose.Schema;
  var twitterSchema = new Schema ({
          id: {type: Number, index: {unique: true, dropDups: true}},
          created_at: Date,
          user: [{
                  id: Number,
                  name: String,
                  screen_name: String,
                  location: String
          }],
          text: String,
          keywords: []
  });
  
  twitterSchema.plugin(textSearch);
  
  twitterSchema.index({keywords: 'text' });
  
  var Tweets = mongoose.model('Tweets', twitterSchema);
  
  Tweets.create({text: 'flu', keywords: ['disease', 'doctor', 'shots']}, function(err){
      if(err){
          console.log('First error: ' + err);
      }
  
      Tweets.textSearch('shots', function(err, output){
          if(err){
              console.log('This is error: ' + err)
          }
  
          var inspect = require('util').inspect;
          console.log(inspect(output, {depth: null}));
  
     });
  });
  
  exports.Document = function(db) {
    return db.model('Tweets');
  };
  </code></pre>