Changeset 571 for trunk/grails-app
- Timestamp:
- Jun 6, 2010, 12:11:11 AM (14 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/conf/BootStrap.groovy
r508 r571 16 16 createDataService.createBaseData() 17 17 createDataService.createDemoData() 18 createDataService.startLucene() 18 19 } 19 20 test { … … 21 22 createDataService.ensureSystemAndAdminAccess() 22 23 createDataService.createBaseData() 24 createDataService.startLucene(false) 23 25 } 24 26 production { … … 26 28 createDataService.ensureSystemAndAdminAccess() 27 29 createDataService.createBaseData() 30 createDataService.startLucene() 28 31 } 29 32 } -
trunk/grails-app/conf/Searchable.groovy
r562 r571 124 124 * If false, you must manage the index manually using index/unindex/reindex 125 125 */ 126 mirrorChanges = true126 mirrorChanges = false 127 127 128 128 /** … … 137 137 * which means do a non-forking, otherwise "fork" is recommended 138 138 */ 139 bulkIndexOnStartup = true139 bulkIndexOnStartup = false 140 140 141 141 /** -
trunk/grails-app/services/CreateDataService.groovy
r549 r571 13 13 def dateUtilService 14 14 def appConfigService 15 def searchableService 15 16 def inventoryItemService 16 17 def assignedGroupService … … 1502 1503 } 1503 1504 1504 1505 /**************************************** 1506 Call this function instead of .save() 1507 *****************************************/ 1505 /** 1506 * Lucene index and mirroring is disabled at startup. 1507 * Us this to start lucene indexing after creating bootstrap data. 1508 * @param indexInNewThread Whether to run the index in a new thread, defaults to true. 1509 */ 1510 def startLucene(Boolean indexInNewThread = true) { 1511 log.info "Start mirroring lucene index." 1512 searchableService.startMirroring() 1513 if(indexInNewThread) { 1514 Thread.start { 1515 log.info "Rebuilding lucene text search index, bulkIndex in new thread." 1516 searchableService.index() 1517 log.info "Rebuilding lucene text search index, complete." 1518 } 1519 } 1520 else { 1521 log.info "Rebuilding lucene text search index, bulkIndex." 1522 searchableService.index() 1523 log.info "Rebuilding lucene text search index, complete." 1524 } 1525 } 1526 1527 /** 1528 * Lucene index and mirroring during bulk data creation may be slow. 1529 * Us this to stop lucene indexing and restart with startLucene() after data creation. 1530 */ 1531 def stopLucene() { 1532 log.info "Stop mirroring lucene index." 1533 searchableService.stopMirroring() 1534 } 1535 1536 /** 1537 * Call this function instead of .save() 1538 */ 1508 1539 private boolean saveAndTest(object) { 1509 1540 if(!object.save()) { … … 1515 1546 return true 1516 1547 } 1548 1517 1549 }
Note: See TracChangeset
for help on using the changeset viewer.