Changeset 46940
- Timestamp:
- 07/05/06 17:12:24 (2 years ago)
- Files:
-
- CPS3/products/CPSLuceneCatalog/trunk/CHANGES (modified) (1 diff)
- CPS3/products/CPSLuceneCatalog/trunk/catalog.py (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
CPS3/products/CPSLuceneCatalog/trunk/CHANGES
r46872 r46940 4 4 New features: 5 5 ~~~~~~~~~~~~~ 6 - 6 - A multilanguage_support property is introduced on the catalog, defaulting 7 to "True". If set to "False" this skips trying to find all language versions 8 of a proxy an unindex them. This significantly speeds up reindexing. 9 Also, when manage_reindexProxies this property is always turned off, as 10 all language versions will be reindexed anyway. 7 11 Bug fixes: 8 12 ~~~~~~~~~~ CPS3/products/CPSLuceneCatalog/trunk/catalog.py
r46869 r46940 69 69 70 70 security = ClassSecurityInfo() 71 72 multilanguage_support = 1 73 74 71 75 72 76 def __init__(self): … … 300 304 301 305 # We reindex a normal proxy. 302 # Find what languages are in the catalog for this proxy303 uid_view = uid + '/' + cpsutils.KEYWORD_VIEW_LANGUAGE304 306 had_languages = [] 305 306 307 for brain in self.unrestrictedSearchResults(path=uid_view): 308 path = brain.getPath() 309 had_languages.append(path[path.rindex('/')+1:]) 307 if self.multilanguage_support: 308 # Find what languages are in the catalog for this proxy 309 uid_view = uid + '/' + cpsutils.KEYWORD_VIEW_LANGUAGE 310 for brain in self.unrestrictedSearchResults(path=uid_view): 311 path = brain.getPath() 312 had_languages.append(path[path.rindex('/')+1:]) 310 313 311 314 # Do we now have only one language? … … 357 360 # 358 361 359 # Th oseproperties are here only to display the values in ZMI.362 # The server_url properties are here only to display the values in ZMI. 360 363 # The actual used properties are on the nuxeo.lucene catalog 361 364 # utility … … 366 369 'label':'xml-rpc server URL', 367 370 }, 368 ) 371 {'id':'multilanguage_support', 372 'type':'boolean', 373 'mode':'w', 374 'label':'Multi-language support', 375 }, ) 369 376 370 377 manage_options = (CatalogTool.manage_options[2], … … 410 417 411 418 portal = utool.getPortalObject() 419 420 # When reindexing the WHOLE catalog, as we do here, the language 421 # support is pointless, as it's there to reindex all languages of a 422 # proxy, even when you reindex only one of them. Here they all get 423 # reindexed sooner or later anyway: 424 425 if self.multilanguage_support: 426 self.multilanguage_support = False 427 enable_multilanguage_support = True 428 else: 429 enable_multilanguage_support = False 412 430 413 431 # rpaths = ('/gcac_preprod/sections/ouvrages/ouvrage-test-eba',) … … 448 466 stop = time.time() 449 467 LOG.info("Reindexation done in %s secondes" % str(stop-start)) 468 469 # Reset the multi_language_support: 470 if enable_multilanguage_support: 471 self.multilanguage_support = True 450 472 451 473 # Optimize the store
