我进行了更多研究,发现可以通过在映射中将include_in_parent设置为true来实现。
现在,您应该可以执行如下查询
{ "query": { "query_string": { "query": "fields.fieldvalue:sometext" } }}例如:-
"mappings": { "documentmetadatavalue": { "properties": { "id": { "type": "string" }, "fields": { "type": "nested", "include_in_parent": true, "properties": { "fieldId": {"type": "string"}, "fieldvalue": {"type": "string"} } }} } }让我知道是否有帮助。



