Changeset 571 for trunk/grails-app/services
- Timestamp:
- Jun 6, 2010, 12:11:11 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.