title: MongoDB Full Text on an Array within an Array of Elements
body: <p>I am unable to retrieve documents when an array within an array of elements contains text that should match my search.</p>
  
  <p>Here are two example documents:</p>
  
  <pre><code>{
      _id: ...,
      'foo': [
          {
              'name': 'Thing1',
              'data': {
                  'text': ['X', 'X']
              }
          },{
              'name': 'Thing2',
              'data': {
                  'text': ['X', 'Y']
              }
          }
      ]
  }
  
  {
      _id: ...,
      'foo': [
          {
              'name': 'Thing3',
              'data': {
                  'text': ['X', 'X']
              }
          },{
              'name': 'Thing4',
              'data': {
                  'text': ['X', 'Y']
              }
          }
      ]
  }
  </code></pre>
  
  <p>By using the following query, I am able to return both documents:
  <code>db.collection.find({'foo.data.text': {'$in': ['Y']}}</code></p>
  
  <p>However, I am unable to return these results using the full text command/index:
  <code>db.collection.runCommand("text", {search" "Y"})</code></p>
  
  <p>I am certain that the full text search is working, as the same command issuing a search against "Thing1" will return the first document, and "Thing3" returns the second document.</p>
  
  <p>I am certain that both foo.data.text and foo.name are both in the text index when using <code>db.collection.getIndexes()</code>.</p>
  
  <p>I created my index using: <code>db.collection.ensureIndex({'foo.name': 'text', 'foo.data.text': 'text'})</code>.  Here are the indexes as shown by the above command:</p>
  
  <pre><code>    {
              "v" : 1,
              "key" : {
                      "_fts" : "text",
                      "_ftsx" : 1
              },
              "ns" : "testing.collection",
              "background" : true,
              "name" : "my_text_search",
              "weights" : {
                      "foo.data.text" : 1,
                      "foo.name" : 1,
              },
              "default_language" : "english",
              "language_override" : "language",
              "textIndexVersion" : 1
      }
  </code></pre>
  
  <p><strong>Any suggestion on how to get this working with <a href="http://docs.mongodb.org/manual/tutorial/search-for-text/" rel="noreferrer">mongo's full text search</a>?</strong></p>