mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-15 14:03:17 +00:00
[DS-2060] Extended SOLR commit duration due to SpellCheckComponent ("Did you mean")
This commit is contained in:
@@ -66,6 +66,10 @@ public class IndexClient {
|
||||
"(re)build index, wiping out current one if it exists").create(
|
||||
"b"));
|
||||
|
||||
options.addOption(OptionBuilder.isRequired(false).withDescription(
|
||||
"Rebuild the spellchecker, can be combined with -b and -f.").create(
|
||||
"s"));
|
||||
|
||||
options
|
||||
.addOption(OptionBuilder
|
||||
.isRequired(false)
|
||||
@@ -111,15 +115,32 @@ public class IndexClient {
|
||||
} else if (line.hasOption("b")) {
|
||||
log.info("(Re)building index from scratch.");
|
||||
indexer.createIndex(context);
|
||||
checkRebuildSpellCheck(line, indexer);
|
||||
} else if (line.hasOption("o")) {
|
||||
log.info("Optimizing search core.");
|
||||
indexer.optimize();
|
||||
} else if(line.hasOption('s')) {
|
||||
checkRebuildSpellCheck(line, indexer);
|
||||
} else {
|
||||
log.info("Updating and Cleaning Index");
|
||||
indexer.cleanIndex(line.hasOption("f"));
|
||||
indexer.updateIndex(context, line.hasOption("f"));
|
||||
checkRebuildSpellCheck(line, indexer);
|
||||
}
|
||||
|
||||
log.info("Done with indexing");
|
||||
}
|
||||
|
||||
/**
|
||||
* Check the command line options and rebuild the spell check if active.
|
||||
* @param line the command line options
|
||||
* @param indexer the solr indexer
|
||||
* @throws SearchServiceException in case of a solr exception
|
||||
*/
|
||||
protected static void checkRebuildSpellCheck(CommandLine line, IndexingService indexer) throws SearchServiceException {
|
||||
if (line.hasOption("s")) {
|
||||
log.info("Rebuilding spell checker.");
|
||||
indexer.buildSpellCheck();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user