title: How to run term filter on a field which has child fields in Elasticsearch
body: <p>I have a document in my <strong>Elasticsearch</strong> node which contains information about a person's contacts : </p>
  
  <pre><code>"contacts": [
        {
           "id": 1,
           "address": "address1",
           "tel": "40071322",
           "doctor_id": 1,
           "type_id": 1,
           "lng": "51.374720",
           "lat": "35.781986",
           "city_id": 186,
           "province_id": 8,
           "hour_about": null,
           "place_name": null
        },
        {
           "id": 2,
           "address": "address2",
           "tel": null,
           "doctor_id": 1,
           "type_id": 2,
           "lng": "51.520313",
           "lat": "35.726983",
           "city_id": 186,
           "province_id": 8,
           "hour_about": null,
           "place_name": null
        },
        {
           "id": 3,
           "address": "address3",
           "tel": null,
           "doctor_id": 1,
           "type_id": 2,
           "lng": "51.456368",
           "lat": "35.797505",
           "city_id": 186,
           "province_id": 8,
           "hour_about": null,
           "place_name": null
        }
  ]
  </code></pre>
  
  <p>I want to run a <code>term</code> <strong>filter</strong> to find documents that have <code>city_id</code> of <code>X</code> in their <code>contacts</code> fields. How should I do this query when the field itself has children fields like above ?</p>
  
  <p>using <code>elasticsearch php api</code> is preferred =)</p>
  
  <p>Thanks for your help.</p>