我是elasticsearch的新手。
我们目前正在将代码从关系数据库移动到elasticsearch。因此,我们将查询转换为elasticsearch查询格式。
我正在寻找elasticsearch等价于下面的查询-
SELECT Color, SUM(ListPrice), SUM(StandardCost)
FROM Production.Product
WHERE Color IS NOT NULL
AND ListPrice != 0.00
AND Name LIKE 'Mountain%'
GROUP BY Color
有人能给我举一个上面的elasticsearch查询的例子吗?
1条答案
按热度按时间00jrzges1#
你会有一个
products
带a的索引product
根据上面的查询,键入其Map可能如下所示的文档:然后,与上面给出的sql查询等价的es查询将如下所示: