Elasticsearch查询SQL Server LAG函数模拟 [英] Elasticsearch query SQL Server LAG function analog

查看:355
本文介绍了Elasticsearch查询SQL Server LAG函数模拟的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一个SQL Server LAG / LEAD 功能模拟弹性搜索。

I am looking for a SQL Server LAG/LEAD functions analog in Elasticsearch.

假设我有特定条件找到的结果集中的文档列表。结果集也按一定顺序排列。

Assume I have a list of documents in result set found by particular criteria. The result set is also ordered in some order.

我知道该结果集中的一个文档的ID,我需要找到下一个和/或以前的文档相同的结果集。

I know the id of one of the documents in that result set and I need to find next and/or previous document in the same result set.

SQL Server 2012及更高版本具有 LAG / LEAD 函数以获取下一个/上一行记录集。所以我想知道弹性搜索中是否有这样的功能。

SQL Server 2012 and above has LAG/LEAD functions to get next/previous row in the recordset. So I wondering if there is such functionality in the elasticsearch.

请问请点击相应的文档/示例吗?

Could you please point me on the corresponding documentation/examples please?

推荐答案

没有。来自关系地的许多东西并不直接转化为弹性地。你想用LAG / LEAD做什么?只需要获得更多的结果,查找或者关闭该列表,就可以获得足够的ID。我想象它的东西更有趣,但我不想猜测。

There isn't. Lots of stuff from relational land doesn't translate directly into Elasticsearch land. What do you want to do with LAG/LEAD? Just getting the ids is simple enough by asking for more results and looking up or down the list. I imagine its something more fun but I don't want to speculate.

这篇关于Elasticsearch查询SQL Server LAG函数模拟的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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