Skip to content

Commit

Permalink
Improve solr reindex performance by using a tuple instead a set for idxs
Browse files Browse the repository at this point in the history
  • Loading branch information
elioschmutz committed Mar 28, 2024
1 parent 71c9900 commit f322c3d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion opengever/maintenance/scripts/repository_migration.py
Expand Up @@ -1428,7 +1428,10 @@ def reindex(self):
if not obj:
logger.error("Could not find {} to reindex. Skipping".format(uid))
continue
obj.reindexObject(idxs=idxs)

# WARNING! idxs needs to be a tuple, otherwise solr will always update all attributes
# See: https://github.com/plone/collective.indexing/blob/2.0/src/collective/indexing/queue.py#L142
obj.reindexObject(idxs=tuple(idxs))
if obj.portal_type == 'opengever.task.task':
# make sure that the model is up to date.
TaskSqlSyncer(obj, None).sync()
Expand Down

0 comments on commit f322c3d

Please sign in to comment.