简体   繁体   English

ElasticSearch。 滚动是否需要扫描?

[英]ElasticSearch. Does scroll require scan?

Using ElasticSearch 1.2.1 使用ElasticSearch 1.2.1

I have a few questions regarding scroll. 关于滚动,我有几个问题。

I would like to export a fairly large amount of documents based on a specified query and ORDER DOES MATTER. 我想根据指定的查询和ORDER DOES MATTER导出大量文档。

1- Does scroll require scan? 1-滚动是否需要扫描? Because the docs mention to see scan for more information regarding scroll. 因为文档提到要查看扫描以获取有关滚动的更多信息。 2- If I understand correctly to go through the full scroll, you keep scrolling until you get nothing back? 2-如果我正确理解要进行完整滚动,则继续滚动直到什么都没回来? 3- Does scrolling use RAM or cahce the results? 3-滚动是否使用RAM或缓存结果?

似乎滚动不需要扫描,但是如果需要,您可以同时使用两者。

  1. Nope, it doesn't. 不,不是。 In fact, if order does matter, you can't use scan. 实际上,如果顺序很重要,则不能使用扫描。
  2. Yes, each time passing new scrollId returned by previous scroll query (it will differ for each call). 是的,每次传递由上一个滚动查询返回的新scrollId(每次调用都会有所不同)。
  3. To be honest i don't know, but it keeps the state of your query between scrolls for amount of time you choose, so it uses RAM i think. 老实说,我不知道,但是它可以在您选择的时间段内保持查询状态,因此它使用RAM。 I suppose it doesn't cache results. 我想它不会缓存结果。

Scan is a search type, there are few search type you can specify to match your results and improve performance. 扫描是一种搜索类型,您可以指定几种搜索类型以匹配结果并提高性能。 Scan does fetch the doc in the order they are, that is sort by doc order. 扫描的确按其顺序获取文档,即按文档顺序排序。 If you dont use scan then probably you should explicitly mention the sort order with the search query. 如果您不使用扫描,则可能应该在搜索查询中明确提及排序顺序。 If you mention any other sort parameter then its a overload for a merger while scrolling, hence scan is preferred. 如果您提到其他任何排序参数,则在滚动时合并是重载,因此首选扫描。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM