Changeset 15748 for main/waeup.kofa/trunk/src/waeup
- Timestamp:
- 4 Nov 2019, 10:15:44 (5 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/hostels/hostel.py
r15741 r15748 345 345 if 'bed_id' not in cat.keys(): 346 346 nothing_to_do = False 347 # replace original `updateIndex` method 348 def updateIndexReplacement(index): 349 reindex_cat(cat) 350 cat._updateIndex = cat.updateIndex 351 cat.updateIndex = updateIndexReplacement 352 # setup catalog 347 353 cat[u'bed_id'] = FieldIndex(field_name=u'bed_id') 354 cat.updateIndex = cat._updateIndex # undo changes 348 355 logger.info( 349 356 '%s: bed_id index added to beds_catalog.' -
main/waeup.kofa/trunk/src/waeup/kofa/utils/helpers.py
r15739 r15748 27 27 import shutil 28 28 import tempfile 29 import transaction 29 30 import grok 30 31 from cStringIO import StringIO … … 956 957 uids = get_catalog_docids(cat) 957 958 print("Found %s entries..." % len(uids)) 958 for docid in uids:959 for n, docid in enumerate(uids): 959 960 ob = uidutil.getObject(docid) 960 961 cat.index_doc(docid, ob) 962 # indexes can become huge. commit changes every 5000th round to 963 # keep the memory footprint of catalogs `updateIndex` manageable 964 if not n % 5000: 965 transaction.commit() 961 966 d2 = datetime.datetime.now() 962 967 print("Finished. %s" % (d2 - d1))
Note: See TracChangeset for help on using the changeset viewer.