You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by se...@apache.org on 2022/01/19 15:39:13 UTC
[incubator-ponymail-foal] branch master updated: Not used in Foal
This is an automated email from the ASF dual-hosted git repository.
sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git
The following commit(s) were added to refs/heads/master by this push:
new 5dbcded Not used in Foal
5dbcded is described below
commit 5dbcded7f41b6c365356b2334e08e45003c27af8
Author: Sebb <se...@apache.org>
AuthorDate: Wed Jan 19 15:38:11 2022 +0000
Not used in Foal
(was used by LUA API)
---
tools/plugins/elastic.py | 20 +-------------------
1 file changed, 1 insertion(+), 19 deletions(-)
diff --git a/tools/plugins/elastic.py b/tools/plugins/elastic.py
index 95f488c..ac78d5a 100755
--- a/tools/plugins/elastic.py
+++ b/tools/plugins/elastic.py
@@ -155,30 +155,12 @@ class Elastic:
def update(self, **kwargs):
return self.es.update(**kwargs)
+ # TODO: is this used? Does it make sense for ES7 ?
def scan(self, scroll="3m", size=100, **kwargs):
return self.es.search(
search_type="scan", size=size, scroll=scroll, **kwargs
)
- def scan_and_scroll(self, scroll="3m", size=100, **kwargs):
- """ Run a backwards compatible scan/scroll, passing an iterator
- that returns one page of hits per iteration. This
- incorporates es.scroll for continuous iteration, and thus the
- scroll() does NOT need to be called at all by the calling
- process. """
- results = self.es.search(size=size, scroll=scroll, **kwargs)
- if results["hits"].get("hits", []): # Might not be there in 2.x?
- yield results
-
- # While we have hits waiting, scroll...
- scroll_size = results["hits"]["total"]
- while scroll_size > 0:
- results = self.scroll(scroll_id=results["_scroll_id"], scroll=scroll)
- scroll_size = len(
- results["hits"]["hits"]
- ) # If >0, try another scroll next.
- yield results
-
def get(self, **kwargs):
return self.es.get(**kwargs)