title: Unable to retrieve nested object within Elastic Search
body: <p>An ELK noob here, having the ELK task drop to me last minute.</p>
  <p>We are adding an extra data named <code>prospects</code> into the vehicle index, so the user could search for it. I'm able to to add the <code>prospects</code> into the index, now I'm unable to get the nested <code>prospects</code> obj within the vehicle index. I'm using Elastic Search &amp; Kibana v6.8.11, and elastic-search-rails gem and checked up the docs on nested object. My search method looks correct according to the docs. Would like some expert to point out what when wrong here, please let me know if you need more info.</p>
  <p>Here is the suppose index obj -</p>
  <pre><code>      {
          &quot;_index&quot; : &quot;vehicles&quot;,
          &quot;_type&quot; : &quot;_doc&quot;,
          &quot;_id&quot; : &quot;3MZBxxxxxxx&quot;,
          &quot;_score&quot; : 0.0,
          &quot;_source&quot; : {
            &quot;vin&quot; : &quot;3MZBxxxxxxx&quot;,
            &quot;make&quot; : &quot;mazda&quot;,
            &quot;model&quot; : &quot;mazda3&quot;,
            &quot;color&quot; : &quot;unknown&quot;,
            &quot;year&quot; : 2018,
            &quot;vehicle&quot; : &quot;2018 mazda mazda3&quot;,
            &quot;trim&quot; : &quot;grand touring&quot;,
            &quot;estimated_mileage&quot; : null,
            &quot;dealership&quot; : [
              209
            ],
            &quot;current_owner_group_id&quot; : null,
            &quot;current_owner_customer_id&quot; : null,
            &quot;last_service_date&quot; : null,
            &quot;last_service_revenue&quot; : null,
            &quot;purchase_type&quot; : [ ],
            &quot;in_service_date&quot; : null,
            &quot;deal_headers&quot; : [ ],
            &quot;services&quot; : [ ],
            &quot;customers&quot; : [ ],
            &quot;salesmen&quot; : null,
            &quot;service_appointments&quot; : [ ],
            &quot;prospects&quot; : [
              {
                &quot;first_name&quot; : &quot;Kammy&quot;,
                &quot;last_name&quot; : &quot;Maytag&quot;,
                &quot;name&quot; : &quot;Kammy Maytag&quot;,
                &quot;company_name&quot; : null,
                &quot;emails&quot; : [ ],
                &quot;phone_numbers&quot; : [ ],
                &quot;address&quot; : &quot;31119 field&quot;,
                &quot;city&quot; : &quot;helen&quot;,
                &quot;state&quot; : &quot;keller&quot;,
                &quot;zip&quot; : &quot;81411&quot;,
                &quot;within_dealership_aoi_region&quot; : true,
                &quot;dealership_ids&quot; : [
                  209
                ],
                &quot;dealership_dppa_protected_ids&quot; : [
                  209
                ],
                &quot;registration_id&quot; : 12344,
                &quot;id&quot; : 1054,
                &quot;prospect_source_id&quot; : &quot;12344&quot;,
                &quot;type&quot; : &quot;Prospect&quot;
              }
            ]
          }
        }
      ]
    }
  }
  </code></pre>
  <p>Here is how I'm trying to get it -</p>
  <pre><code> GET /vehicles/_search
  {
    &quot;query&quot;: {
      &quot;bool&quot;: {
        &quot;must&quot;: { &quot;match_all&quot;: {} },
        &quot;filter&quot;: [
          { &quot;term&quot;: { &quot;dealership&quot;: &quot;209&quot; } },
          {
            &quot;nested&quot;: {
              &quot;path&quot;: &quot;prospects&quot;,
              &quot;query&quot;: {
                &quot;bool&quot;: {
                  &quot;must&quot;: [
                    { &quot;term&quot;: { &quot;prospects.first_name&quot;: &quot;Kammy&quot; } },
                    { &quot;term&quot;: { &quot;prospects.dealership&quot;: &quot;209&quot; } },
                    { &quot;term&quot;: { &quot;prospects.type&quot;: &quot;Prospect&quot; } }
                  ]
                }
              }
            }
          },
          { &quot;bool&quot;: { &quot;must_not&quot;: { &quot;term&quot;: { &quot;purchase_type&quot;: &quot;Wholesale&quot; } } } }
        ]
      }
    },
    &quot;sort&quot;: [{ &quot;_doc&quot;: { &quot;order&quot;: &quot;asc&quot; } }]
  }
  </code></pre>