Author: nzamosenchuk
Date: 2011-08-16 05:32:55 -0400 (Tue, 16 Aug 2011)
New Revision: 4756
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java
Log:
EXOJCR-1481 : Conditional check added.
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java 2011-08-15
15:06:52 UTC (rev 4755)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java 2011-08-16
09:32:55 UTC (rev 4756)
@@ -3370,18 +3370,26 @@
if (isOnline)
{
log.info("Setting index back online");
- offlineIndex.commit(true);
- online = true;
- // cleaning stale indexes
- for (PersistentIndex staleIndex : staleIndexes)
+ if (modeHandler.getMode() == IndexerIoMode.READ_WRITE)
{
- deleteIndex(staleIndex);
+ offlineIndex.commit(true);
+ online = true;
+ // cleaning stale indexes
+ for (PersistentIndex staleIndex : staleIndexes)
+ {
+ deleteIndex(staleIndex);
+ }
+ //invoking offline index
+ invokeOfflineIndex();
+ staleIndexes.clear();
+ doInitIndexMerger();
+ merger.start();
}
- //invoking offline index
- invokeOfflineIndex();
- staleIndexes.clear();
- doInitIndexMerger();
- merger.start();
+ else
+ {
+ online = true;
+ staleIndexes.clear();
+ }
}
// switching to OFFLINE
else
Show replies by date