Class GlobalSolrFullReIndexOperation
java.lang.Object
org.broadleafcommerce.core.search.service.solr.index.GlobalSolrFullReIndexOperation
- All Implemented Interfaces:
SolrIndexOperation
Rebuilds the entire Solr index. This type of indexing operation prevents other threads from performing any other global
reindex operation. The rebuild operation is done on
SolrContext#getReindexServer() and then at the end, the
Solr cores are swapped. Prior to building the index, all documents from SolrContext#getReindexServer() are
deleted.- Author:
- Phillip Verheyden (phillipuniverse)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected SolrIndexServiceprotected static booleanprotected static final Objectprotected SolrHelperServiceprotected SolrConfiguration -
Constructor Summary
ConstructorsConstructorDescriptionGlobalSolrFullReIndexOperation(SolrIndexService indexService, SolrConfiguration solrConfiguration, SolrHelperService shs, boolean errorOnConcurrentReindex) -
Method Summary
Modifier and TypeMethodDescriptionvoidExecutes after building each page, this is where any filters or cleanup for building can be taken care ofvoidExecutes after the count, this is where any filters or cleanup for counting can be taken care ofvoidExecutes after the read, this is where any filters or cleanup for reading can be taken care ofvoidExecutes before building each page, this is where any filters or setup for building can be taken care ofvoidExecutes before the count, this is where any filters or setup for counting can be taken care ofvoidExecutes before the read, this is where any filters or setup for reading can be taken care ofWhich collection the index should be built onorg.apache.solr.client.solrj.SolrClientWhichSolrClientthe index should be built onbooleanGrab some sort of lock so that nothing else can index items at the same timevoidIf a lock was obtained inSolrIndexOperation.obtainLock()this releases itMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.broadleafcommerce.core.search.service.solr.index.SolrIndexOperation
buildPage, countIndexables, readIndexables
-
Field Details
-
LOCK_OBJECT
-
IS_LOCKED
protected static boolean IS_LOCKED -
errorOnConcurrentReIndex
protected boolean errorOnConcurrentReIndex -
solrConfiguration
-
indexService
-
shs
-
-
Constructor Details
-
GlobalSolrFullReIndexOperation
public GlobalSolrFullReIndexOperation(SolrIndexService indexService, SolrConfiguration solrConfiguration, SolrHelperService shs, boolean errorOnConcurrentReindex)
-
-
Method Details
-
obtainLock
public boolean obtainLock()Description copied from interface:SolrIndexOperationGrab some sort of lock so that nothing else can index items at the same time- Specified by:
obtainLockin interfaceSolrIndexOperation
-
releaseLock
public void releaseLock()Description copied from interface:SolrIndexOperationIf a lock was obtained inSolrIndexOperation.obtainLock()this releases it- Specified by:
releaseLockin interfaceSolrIndexOperation
-
getSolrServerForIndexing
public org.apache.solr.client.solrj.SolrClient getSolrServerForIndexing()Description copied from interface:SolrIndexOperationWhichSolrClientthe index should be built on- Specified by:
getSolrServerForIndexingin interfaceSolrIndexOperation
-
getSolrCollectionForIndexing
Description copied from interface:SolrIndexOperationWhich collection the index should be built on- Specified by:
getSolrCollectionForIndexingin interfaceSolrIndexOperation
-
beforeCountIndexables
public void beforeCountIndexables()Description copied from interface:SolrIndexOperationExecutes before the count, this is where any filters or setup for counting can be taken care of- Specified by:
beforeCountIndexablesin interfaceSolrIndexOperation
-
afterCountIndexables
public void afterCountIndexables()Description copied from interface:SolrIndexOperationExecutes after the count, this is where any filters or cleanup for counting can be taken care of- Specified by:
afterCountIndexablesin interfaceSolrIndexOperation
-
beforeReadIndexables
public void beforeReadIndexables()Description copied from interface:SolrIndexOperationExecutes before the read, this is where any filters or setup for reading can be taken care of- Specified by:
beforeReadIndexablesin interfaceSolrIndexOperation
-
afterReadIndexables
public void afterReadIndexables()Description copied from interface:SolrIndexOperationExecutes after the read, this is where any filters or cleanup for reading can be taken care of- Specified by:
afterReadIndexablesin interfaceSolrIndexOperation
-
beforeBuildPage
public void beforeBuildPage()Description copied from interface:SolrIndexOperationExecutes before building each page, this is where any filters or setup for building can be taken care of- Specified by:
beforeBuildPagein interfaceSolrIndexOperation
-
afterBuildPage
public void afterBuildPage()Description copied from interface:SolrIndexOperationExecutes after building each page, this is where any filters or cleanup for building can be taken care of- Specified by:
afterBuildPagein interfaceSolrIndexOperation
-