什么是ElasticSearch等同于SQL子查询? [英] What is the ElasticSearch equivalent for an SQL subquery?

查看:1799
本文介绍了什么是ElasticSearch等同于SQL子查询?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您可以在ElasticSearch中嵌套查询查询,因此一个查询的输出是另一个查询的输入。
另一个问题的方法是如何链接或管道查询在一起?



这应该类似于SQL中的IN运算符或子查询



ie: -

中选择au_lname,au_fname,title(select au_lname,au_fname,au_id from pubs.dbo.authors
where state =' CA')



SELECT名称
FROM AdventureWorks2008R2.Production.Product
WHERE ListPrice =
(SELECT ListPrice
FROM AdventureWorks2008R2.Production.Product
WHERE Name ='Chainring Bolts');

解决方案

弹性搜索不' t支持子查询;您将需要执行第一个查询,然后使用第一个查询的结果作为输入构造第二个查询。


Can you nest queries logically in ElasticSearch, so the output of one query is the input to another query. Another, way to ask is how can I chain or pipe queries together?

This should be analogous to the IN operator or subqueries in SQL

i.e.:- select au_lname, au_fname, title from (select au_lname, au_fname, au_id from pubs.dbo.authors where state = 'CA') or

SELECT Name FROM AdventureWorks2008R2.Production.Product WHERE ListPrice = (SELECT ListPrice FROM AdventureWorks2008R2.Production.Product WHERE Name = 'Chainring Bolts' );

解决方案

Elasticsearch doesn't support subqueries; you would need to perform your first query, then construct a second query using the results of the first query as an input.

这篇关于什么是ElasticSearch等同于SQL子查询?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆