title: has_child not working as expected inside has_parent,
body: <p>I have a parent child relationship in my elasticsearch 7.9 where I am having the <strong>car</strong> as a parent type and it has multiple child types like <strong>honda, suzuki, volvo</strong> now I want to have a child of type volvo and parent type is car.</p>
  <pre class="lang-json prettyprint-override"><code>{
    &quot;query&quot;: {
      &quot;has_parent&quot;: {
        &quot;parent_type&quot;: &quot;car&quot;,
        &quot;query&quot;: {
          &quot;has_child&quot;: {
            &quot;type&quot;: &quot;volvo&quot;,
            &quot;query&quot;: {
              &quot;match_all&quot;: {}
            }
          }
        }
      }
    }
  }
  </code></pre>
  <p>It is returning the objects having <strong>child type</strong> honda as well.
  Where I am wrong ?
  Thanks.</p>
  <ul>
  <li>what should be the query where I want the parent_type car with an id xxxxx and child is volvo.</li>
  </ul>
  <p><strong>Updated</strong></p>
  <p>Here is the mapping.</p>
  <pre class="lang-json prettyprint-override"><code>{
    &quot;car&quot;: {
      &quot;mappings&quot;: {
        &quot;properties&quot;: {
          &quot;_class&quot;: {
            &quot;type&quot;: &quot;text&quot;,
            &quot;fields&quot;: {
              &quot;keyword&quot;: {
                &quot;type&quot;: &quot;keyword&quot;,
                &quot;ignore_above&quot;: 256
              }
            }
          },
          &quot;made&quot;: {
            &quot;type&quot;: &quot;nested&quot;,
            &quot;properties&quot;: {
              &quot;model&quot;: {
                &quot;type&quot;: &quot;keyword&quot;
              }
            }
          },
          &quot;relation&quot;: {
            &quot;type&quot;: &quot;join&quot;,
            &quot;eager_global_ordinals&quot;: true,
            &quot;relations&quot;: {
              &quot;car&quot;: [&quot;volvo&quot;, &quot;suzuki&quot;, &quot;honda&quot;]
            }
          }
        }
      }
    }
  }
  </code></pre>