【发布时间】:2022-10-14 14:42:14
【问题描述】:
我对弹性搜索比较陌生。我可以在开发工具中进行简单的查询。我需要帮助将以下 sql 转换为 es 查询
select c.conversationid from conversations c
where c.conversationid not in
(select s.conversationid from conversations s
where s.type='end' and s.conversationid=c.conversationid)
索引如下所示。
| conversationid | type |
|---|---|
| 1 | start |
| 2 | start |
| 1 | end |
| 3 | start |
如果我执行上述查询,我将得到以下结果。
对话ID
2
3
【问题讨论】:
-
尝试使用SQL API。
-
sql api 不支持子查询{
"error": { "reason": "There was internal problem at backend", "details": "Unsupported subquery", "type": "IllegalStateException" }, "status": 503 }
标签: elasticsearch