原因是因为从ES 5.0开始,_source
in inner_hits
中不再支持短格式,而仅支持完整的对象格式(with includes
和excludes
)(请参阅此未解决的问题)
您的查询可以这样重写,它将起作用:
{ "query": { "bool": { "should": [ { "match": { "title": "gone" } }, { "nested": { "path": "timedTextLines", "query": { "match": { "timedTextLines.textLine": "damn" } }, "inner_hits": { "_source": { "includes":[ "timedTextLines.startTime", "timedTextLines.endTime" ] }, "highlight": { "fields": { "timedTextLines.textLine": { } } } } } } ] } }, "_source":"false" }