title: Querying nested object in elasticsearch
body: <p>My mapping looks like the following:</p>
  
  <pre><code>    "mappings": {
          "nodes": {
              "properties": {
                  "createdAt": {
                      "type": "date",
                      "format": "dateOptionalTime"
                  },
                  "data": {
                      "type": "string"
                  },
                  "isFile": {
                      "type": "boolean"
                  },
                  "isPublic": {
                      "type": "boolean"
                  },
                  "location": {
                      "properties": {
                          "_id": {
                              "type": "string"
                          }
                      }
                  },
                  "name": {
                      "type": "string"
                  },
                  "owner": {
                      "properties": {
                          "_id": {
                              "type": "string"
                          },
                          "username": {
                              "type": "string"
                          }
                      }
                  },
                  "sharedWith": {
                      "type": "object"
                  }
              }
          }
      }
  </code></pre>
  
  <p>When I do the following query:</p>
  
  <pre><code>"filter": {
        "term": {
              "owner.username": "user_69d349"
        }
  }
  </code></pre>
  
  <p>I get proper results, but when I do</p>
  
  <pre><code>"filter": {
      "term": {
          "owner._id": "RvdDC"
      }
  }
  </code></pre>
  
  <p>I get no results.</p>
  
  <p>I'm using the following document:</p>
  
  <pre><code>{
      "_index": "nodess",
      "_type": "nodes",
      "_id": "I7Cac9n",
      "_score": 1.0,
      "_source": {
          "name": "stream",
          "isFile": true,
          "owner": {
              "_id": "RvdDC",
              "username": "user_69349"
          },
          "sharedWith": [],
          "isPublic": false,
          "location": {
              "_id": null
          },
          "data": "baked baked baked hey",
          "createdAt": "2015-03-24T00:53:53.551Z"
      }
  }
  </code></pre>