我有一个索引,其中记录了特定项目的成功/失败标志的数据。我想获得失败和从未成功的项目的唯一列表。通常从时间Angular 来看,失败后预期会成功
样品输入
| 日期|用户|现况|
| - ------|- ------|- ------|
| 一月一日|用户1|未通过|
| 2002年1月|用户1|成功|
| 一月一日|用户2|未通过|
| 2002年1月|用户2|未通过|
输出将仅为user 2
我有一个索引,其中记录了特定项目的成功/失败标志的数据。我想获得失败和从未成功的项目的唯一列表。通常从时间Angular 来看,失败后预期会成功
样品输入
| 日期|用户|现况|
| - ------|- ------|- ------|
| 一月一日|用户1|未通过|
| 2002年1月|用户1|成功|
| 一月一日|用户2|未通过|
| 2002年1月|用户2|未通过|
输出将仅为user 2
1条答案
按热度按时间4si2a6ki1#
尾巴;
我不确定是否有简单的方法可以做到这一点,纯粹使用
Elasticsearch
,但是您可以获取每个用户的所有状态,然后过滤包含success
的状态。溶液
要设置:
下面是查询
你应该得到:
现在,您只需筛选出具有
status.buckets > 1
status.buckets[0].key == 'success'
你应该很好。