MERGED BY HAND r5362 from branch vivonih-rel-1.1-maint
Removing search index rebuild at tomcat startup NIHVIVO-900
This commit is contained in:
parent
60f6f401f3
commit
30890a7b5f
1 changed files with 75 additions and 66 deletions
|
@ -132,10 +132,18 @@ public class LuceneSetup implements javax.servlet.ServletContextListener {
|
|||
builder.setClassesProhibitedFromSearch(
|
||||
new ProhibitedFromSearch(DisplayVocabulary.PRIMARY_LUCENE_INDEX_URI, displayOntModel));
|
||||
|
||||
log.debug("**** End of " + this.getClass().getName() + ".contextInitialized()");
|
||||
if( (Boolean)sce.getServletContext().getAttribute(INDEX_REBUILD_REQUESTED_AT_STARTUP) instanceof Boolean &&
|
||||
(Boolean)sce.getServletContext().getAttribute(INDEX_REBUILD_REQUESTED_AT_STARTUP) ){
|
||||
builder.doIndexRebuild();
|
||||
log.info("Rebuild of search index required before startup.");
|
||||
while( builder.isIndexing() ){
|
||||
Thread.currentThread().sleep(200);
|
||||
log.info("Still rebulding search index");
|
||||
}
|
||||
log.info("Search index rebuild completed.");
|
||||
}
|
||||
|
||||
// Start a rebuild each time the server starts.
|
||||
builder.doIndexRebuild();
|
||||
log.debug("**** End of " + this.getClass().getName() + ".contextInitialized()");
|
||||
} catch (Throwable t) {
|
||||
log.error("***** Error setting up Lucene search *****", t);
|
||||
}
|
||||
|
@ -211,6 +219,7 @@ public class LuceneSetup implements javax.servlet.ServletContextListener {
|
|||
return analyzer;
|
||||
}
|
||||
|
||||
public static final String INDEX_REBUILD_REQUESTED_AT_STARTUP = "LuceneSetup.indexRebuildRequestedAtStarup";
|
||||
public static final String ANALYZER= "lucene.analyzer";
|
||||
public static final String INDEX_DIR = "lucene.indexDir";
|
||||
public static final String SEARCH_DATAPROPERTY_BLACKLIST =
|
||||
|
|
Loading…
Add table
Reference in a new issue