SQL 子查询的 ElasticSearch 等效项是什么?

编程入门 行业动态 更新时间:2024-10-24 19:29:58
本文介绍了SQL 子查询的 ElasticSearch 等效项是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

您能否在 ElasticSearch 中逻辑嵌套查询,因此一个查询的输出是另一个查询的输入.另一种提问方式是如何将查询链接或管道连接在一起?

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?

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

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

即:-选择 au_lname, au_fname, title from(从 pubs.dbo.authors 中选择 au_lname、au_fname、au_id其中状态 = 'CA')或

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

选择名称来自 AdventureWorks2008R2.Production.Product哪里 ListPrice =(选择标价来自 AdventureWorks2008R2.Production.ProductWHERE 名称 = '链环螺栓');

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

推荐答案

Elasticsearch 不支持子查询;您需要执行第一个查询,然后使用第一个查询的结果作为输入构造第二个查询.

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.

更多推荐

SQL 子查询的 ElasticSearch 等效项是什么?

本文发布于:2023-10-07 15:31:40,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1469785.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:SQL   ElasticSearch

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!