title: MongoDB full text search using PHP
body: <p>It seems that my searching for how to do this brings back results that are a year old and apparently no longer work or I am not doing something correctly.</p>
  
  <p>Through the MongoDB command line, I have run this for indexing:</p>
  
  <p>db.collectiontest.ensureIndex( { "$**": "text" }, { name: "TextIndex" } )</p>
  
  <p>Did this based on the example at</p>
  
  <p><a href="http://docs.mongodb.org/manual/tutorial/create-text-index-on-multiple-fields/" rel="nofollow noreferrer">http://docs.mongodb.org/manual/tutorial/create-text-index-on-multiple-fields/</a></p>
  
  <p>I do not receive an error when that is executed.</p>
  
  <p>Here are 2 of the Stackoverflow postings I have tried:</p>
  
  <p><a href="https://stackoverflow.com/questions/16070957/how-to-search-in-fulltext-index-using-php-in-mongodb">How to search in fulltext index using php in mongodb</a></p>
  
  <p><a href="https://stackoverflow.com/questions/15313805/mongodb-collection-runcommand-from-php">MongoDB Collection runCommand from PHP</a></p>
  
  <p>The last post, I tried the accepted answer except the ensure index since I did that via command line and the poster's solution as well. Both methods returns a message showing "Array ( [errmsg] => no such cmd: text [bad cmd] =>" .</p>
  
  <p>I'm running a vm of Ubuntu Server 12 with latest release versions of PHP and MongoDB.</p>
  
  <p>Thanks,</p>
  
  <p>James</p>