}
}
private void createOrUpdateDBIndex(WGDatabase db, Set newConnectedDBKeys) {
LuceneConfiguration config;
// if database is already in index on the filesystem
HashMap currentDBsInIndexOnFileSystem = _indexConfig.retrieveIndexedDbs();
String dbKey = db.getDbReference();
if (currentDBsInIndexOnFileSystem.containsKey(dbKey)) {
LuceneConfiguration oldConfig = (LuceneConfiguration) currentDBsInIndexOnFileSystem.get(dbKey);
LuceneConfiguration newConfig = retrieveLuceneConfig(dbKey);
// if configuration has changed
if (!oldConfig.equals(newConfig)) {
// update database
updateDatabase(dbKey, newConfig);
if (newConfig.isEnabled()) {
registerForContentEvents(db);
// rebuild index of db
_core.getLog().info("Indexing rules for db '" + dbKey + "' has changed. Indexed content will be truncated and reindexed ...");
addDBUpdateRequest(new IndexingRequest(dbKey, null, true));
} else {