title: elasticsearch filter on object property
body: <p>I am trying to filter a term on object (person) property (name) but dont seem to get what's going wrong. If I filter on field "t" it works but I cant seem to filter on object! Can anyone please help!</p>
  
  <p>My query is below:</p>
  
  <pre><code>"query": {
      "filtered" : {
          "filter" : {
              "term" : { "person.fname" : "JOHN"}
          }      
      }
  
  }
  </code></pre>
  
  <p>My mapping:</p>
  
  <pre><code>    {
          "_ttl": {"enabled": true, "default": '90d'},
  
          "properties" : {
              "t": { "type" : "date" },
  
              "person": {   "type" : "object",
                      "properties" : {
                        "fname" : { "type" : "string"},
                        "lname" : { "type" : "string"}
                      }
              }
  
          }
  
      }
  </code></pre>
  
  <p>This document exist in the index...</p>
  
  <pre><code>{
    "_index" : "personindex",
    "_type" : "S",
    "_id" : "AUxnFFrAGK3sw8tqMMY0",
    "_score" : 1.0,
    "_source":{"t":1427658527178,"person":{"fname":"JOHN","lname":"DOE"}}
  }
  </code></pre>