<p dir="auto">if you have a parent/child relationship doing a query that contains a <code class="notranslate">has_child</code> will result in error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="curl localhost:9200/_search -d '{
    &quot;highlight&quot;: {&quot;fields&quot;: {&quot;title&quot;: {}}},
    &quot;query&quot;: {
        &quot;has_child&quot;: {
            &quot;query&quot;: {&quot;match&quot;: {&quot;body&quot;: &quot;drip&quot;}},
            &quot;type&quot;: &quot;answer&quot;
        }
    }
}'"><pre class="notranslate"><code class="notranslate">curl localhost:9200/_search -d '{
    "highlight": {"fields": {"title": {}}},
    "query": {
        "has_child": {
            "query": {"match": {"body": "drip"}},
            "type": "answer"
        }
    }
}'
</code></pre></div>
<p dir="auto">Error returned:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{
    &quot;type&quot;:&quot;illegal_state_exception&quot;,
    &quot;reason&quot;:&quot;can't load global ordinals for reader of type: class org.apache.lucene.search.highlight.WeightedSpanTermExtractor$DelegatingLeafReader must be a DirectoryReader&quot;
}"><pre class="notranslate"><code class="notranslate">{
    "type":"illegal_state_exception",
    "reason":"can't load global ordinals for reader of type: class org.apache.lucene.search.highlight.WeightedSpanTermExtractor$DelegatingLeafReader must be a DirectoryReader"
}
</code></pre></div>
<p dir="auto">Works fine on 2.0.0, fails on 2.1.0 and later.</p>
<p dir="auto">When I was upgraded es from 2.0 to 2.1, highlight feature stop working.</p>
<p dir="auto">I got this error message:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{
  &quot;shard&quot;: 0,
  &quot;index&quot;: &quot;4odevelop_4o&quot;,
  &quot;node&quot;: &quot;XiZaRocLQGuBwZPg58Naqw&quot;,
  &quot;reason&quot;: {
    &quot;type&quot;: &quot;illegal_state_exception&quot;,
    &quot;reason&quot;: &quot;can't load global ordinals for reader of type: class org.apache.lucene.search.highlight.WeightedSpanTermExtractor$DelegatingLeafReader must be a DirectoryReader&quot;
  }
}"><pre class="notranslate"><code class="notranslate">{
  "shard": 0,
  "index": "4odevelop_4o",
  "node": "XiZaRocLQGuBwZPg58Naqw",
  "reason": {
    "type": "illegal_state_exception",
    "reason": "can't load global ordinals for reader of type: class org.apache.lucene.search.highlight.WeightedSpanTermExtractor$DelegatingLeafReader must be a DirectoryReader"
  }
}
</code></pre></div>