Does _delete_by_query close the scroll context once it has completed or leave it to expire

We have a spark application that needs to use _delete_by_query to do some cleanup after it's finished indexing during a spark task. We're finding that this is causing us to hit the scroll context limit. Our delete requests tend to return very few results so should be executed quickly which leads me to wonder about the following

  • Are the scroll contexts used by _delete_by_query cleared after the delete is finished or left to expire naturally?
  • Would a new scroll be created if the timeout was breached or would the entire request fail?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.