我有以下Elasticsearch索引数据:
id|message_id| action|
1| 1|delivered|
2| 1| opened|
3| 2|delivered|
4| 3|delivered|
5| 4|delivered|
6| 5| opened|
如何查找所有“未打开”的消息?
预期结果:
id|message_id| action|
3| 2|delivered|
4| 3|delivered|
最佳答案
对于单个查询而言,这将很困难,因为您的数据已被规范化,因此将需要自身进行连接,而ESIA真正不可能使用AFAIK。我认为有两种解决方案:
ids filter
和term filter
组合在一起,以获取未打开的查询。 关于elasticsearch - Elasticsearch查找所有 'delivered'但不是 'opened'的消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29622284/