Skip to content

Commit

Permalink
Avoid reindexing SearchableText in Solr during migration.
Browse files Browse the repository at this point in the history
This would access the blobs, which we do not have during
the migration.
  • Loading branch information
Niklaus Johner committed Feb 24, 2021
1 parent 98c9501 commit c60ec72
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions opengever/maintenance/scripts/repository_migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,20 @@ def _update_docproperties(document, raise_on_error=False):
self.patch_refs(handlers, '_update_docproperties', _update_docproperties)


class SkipSearchableTextExtraction(MonkeyPatch):
""" During migration we do not have the blobs, so that we should
avoid extracting full text from the blobs.
"""

def __call__(self):
from ftw.solr.connection import SolrConnection

def extract(self, blob, field, data, content_type):
return

self.patch_refs(SolrConnection, 'extract', extract)


def cleanup_position(position):
"""Remove splitting dots - they're not usefull for comparison.
This only works for grouped_by_three formatter.
Expand Down Expand Up @@ -1382,6 +1396,7 @@ def main():
SkipTaskSyncWith()()
PatchDisableLDAP()()
SkipDocPropsUpdate()()
SkipSearchableTextExtraction()()

logger.info('\n\nstarting analysis...\n')
analyser = RepositoryExcelAnalyser(mapping_path, options.output_directory)
Expand Down

0 comments on commit c60ec72

Please sign in to comment.