gpt4 book ai didi

elasticsearch - Elasticsearch 5.x刷新API问题。如果是这样,实际上是进行高成本操作吗?

转载 作者:行者123 更新时间:2023-12-03 01:49:43 26 4
gpt4 key购买 nike

我正在使用Elasticsearch 2.3,并且我知道Get API是实时的,即无论刷新_间隔如何,API都会检索最近的文档。此操作完全独立于刷新。

在阅读ES 5.x文档时,我发现了以下内容:

By default, the get API is realtime, and is not affected by the refresh rate of the index (when data will become visible for search). If a document has been updated but is not yet refreshed, the get API will issue a refresh call in-place to make the document visible. This will also make other documents changed since the last refresh visible. In order to disable realtime GET, one can set the realtime parameter to false.



我测试并确认在ES 2.3环境中不是这种情况。尽管Get API当然可以获取更新的文档,但它不会刷新索引。

这是否意味着ES 5.x中的Get API实际上是一项非常昂贵的操作,因为刷新也是如此?

最佳答案

如果您有更新并在刷新之前按ID获取文档,则更改只会影响您。这是您的用例中的常见情况吗?然后,您可能想禁用realtime,但是通常的假设是您不应该经常遇到这种情况。

已经在更改的PR上对此进行了讨论(并说明了进行更改的原因),因此您应该发现该讨论很有帮助:https://github.com/elastic/elasticsearch/pull/20102

总体而言,ES 5.x中的GET API可能会花费更高,但是这取决于您的实际用例。

关于elasticsearch - Elasticsearch 5.x刷新API问题。如果是这样,实际上是进行高成本操作吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41468700/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com