@@ -0,0 +1,880 @@
+import sys%0A%0Aimport progressbar%0Afrom django.core.paginator import Paginator%0A%0Afrom website.app import setup_django%0Asetup_django()%0A%0Afrom website.search.search import update_file%0Afrom osf.models import QuickFilesNode%0A%0APAGE_SIZE = 50%0A%0Adef reindex_quickfiles(dry):%0A    qs = QuickFilesNode.objects.all().order_by('id')%0A    count = qs.count()%0A    paginator = Paginator(qs, PAGE_SIZE)%0A%0A    progress_bar = progressbar.ProgressBar(maxval=count).start()%0A    n_processed = 0%0A    for page_num in paginator.page_range:%0A        page = paginator.page(page_num)%0A        for quickfiles in page.object_list:%0A            for file_ in quickfiles.files.all():%0A                if not dry:%0A                    update_file(file_)%0A        n_processed += len(page.object_list)%0A        progress_bar.update(n_processed)%0A%0Aif __name__ == '__main__':%0A    dry = '--dry' in sys.argv%0A    reindex_quickfiles(dry=dry)%0A

Add script to re-index users' files in quickfiles nodes