从多个文档进行弹性搜索拼合数组

时间:2019-11-21 04:02:57

标签: elasticsearch-5 elasticsearch-aggregation

我有以下文件的Elasticsearch索引(学生):

  

_student {“ _id”:1,“ subjectsFailed”:[“英语”,“数学”]} {“ _id”:2,“ subjectsFailed”:[“ Physics”,“ Chemistry”]}

我需要一个将结果返回为`

的查询
  

“ subjectsFailed”:[“英语”,“数学”,“物理”,“化学”]

如何合并subjectsFailed列并将其展平为一个并返回结果?

我看过https://www.elastic.co/guide/en/logstash/current/plugins-filters-mutate.html#plugins-filters-mutate-merge 但没有运气。

有什么想法吗?

0 个答案:

没有答案