--- a/src/pyams_content_es/site.py Fri Nov 16 15:42:07 2018 +0100
+++ b/src/pyams_content_es/site.py Mon Nov 19 11:35:07 2018 +0100
@@ -49,10 +49,11 @@
set_local_registry(application.getSiteManager())
indexer = query_utility(IContentIndexerUtility)
if indexer is not None:
- for document in find_objects_providing(application, IDocumentIndexTarget):
+ for index, document in enumerate(find_objects_providing(application, IDocumentIndexTarget)):
print("Indexing: {0!r}".format(document))
es_client.index_object(document)
- transaction.savepoint()
+ if not (index % 10):
+ transaction.commit()
finally:
set_local_registry(None)
transaction.commit()