Package io.goobi.viewer.controller
Class IndexerTools
java.lang.Object
io.goobi.viewer.controller.IndexerTools
Utility class for Solr indexer interactions (indexing, deleting, etc.).
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic booleandeleteRecord(String pi, boolean createTraceDocument, Path hotfolderPath) deleteRecord.static booleanreIndexCMSPage(CMSPage page, Collection<? extends IndexAugmenter> augmenters) static booleanreIndexPage(String pi, int page) reIndexPage.static booleanreIndexPage(String pi, int page, Collection<? extends IndexAugmenter> augmenters) reIndexPage.static booleanreIndexRecord(String pi) Writes the record into the hotfolder for re-indexing.static booleanreIndexRecord(String pi, Collection<? extends IndexAugmenter> augmenters) Writes the record into the hotfolder for re-indexing.static voidshutdown()Shuts down the background re-indexing executor.static voidtriggerReIndexCMSPage(CMSPage page, List<? extends IndexAugmenter> augmenters) static voidRe-index in background thread to significantly decrease saving times.static voidtriggerReIndexRecord(String pi, List<? extends IndexAugmenter> augmenters)
-
Field Details
-
SUFFIX_FULLTEXT_CROWDSOURCING
ConstantSUFFIX_FULLTEXT_CROWDSOURCING="_txtcrowd".- See Also:
-
SUFFIX_ALTO_CROWDSOURCING
ConstantSUFFIX_ALTO_CROWDSOURCING="_altocrowd".- See Also:
-
SUFFIX_USER_GENERATED_CONTENT
ConstantSUFFIX_USER_GENERATED_CONTENT="_ugc".- See Also:
-
SUFFIX_CMS
ConstantSUFFIX_CMS="_cms".- See Also:
-
-
Method Details
-
shutdown
public static void shutdown()Shuts down the background re-indexing executor. Called byContextListenerduring application shutdown. Waits up to 5 seconds for running tasks to finish. -
triggerReIndexRecord
Re-index in background thread to significantly decrease saving times.- Parameters:
pi- record identifier to re-index
-
triggerReIndexRecord
-
triggerReIndexCMSPage
- Parameters:
page- CMS page to re-index in a background threadaugmenters- list of index augmenters contributing additional data
-
reIndexRecord
Writes the record into the hotfolder for re-indexing. Modules can contribute data for re-indexing. Execution of method can take a while, so if performance is of importance, usetriggerReIndexRecordinstead.- Parameters:
pi- record identifier to re-index- Returns:
- true if the record was successfully exported for re-indexing, false otherwise
- Throws:
DAOException- if any.RecordNotFoundException- if any.
-
reIndexRecord
public static boolean reIndexRecord(String pi, Collection<? extends IndexAugmenter> augmenters) throws DAOException, RecordNotFoundException Writes the record into the hotfolder for re-indexing. Modules can contribute data for re-indexing. Execution of method can take a while, so if performance is of importance, usetriggerReIndexRecordinstead.- Parameters:
pi- record identifier to re-indexaugmenters- list of index augmenters contributing additional data- Returns:
- true if export for reindexing successful; false otherwise
- Throws:
DAOException- if any.RecordNotFoundException- if any.
-
reIndexPage
public static boolean reIndexPage(String pi, int page) throws DAOException, PresentationException, IndexUnreachableException, IOException reIndexPage.- Parameters:
pi- record identifier to re-indexpage- order number of the page to re-index- Returns:
- true if the page was successfully exported for re-indexing, false otherwise
- Throws:
DAOException- if any.PresentationException- if any.IndexUnreachableException- if any.IOException- if any.
-
reIndexPage
public static boolean reIndexPage(String pi, int page, Collection<? extends IndexAugmenter> augmenters) throws PresentationException, IndexUnreachableException, IOException reIndexPage.- Parameters:
pi- record identifier to re-indexpage- order number of the page to re-indexaugmenters- list of index augmenters contributing additional data- Returns:
- true if export for reindexing successful; false otherwise
- Throws:
DAOException- if any.PresentationException- if any.IndexUnreachableException- if any.IOException- if any.
-
deleteRecord
public static boolean deleteRecord(String pi, boolean createTraceDocument, Path hotfolderPath) throws IOException deleteRecord.- Parameters:
pi- record identifier to deletecreateTraceDocument- true to create a .delete trace document, false to purge completelyhotfolderPath- path to the indexer hotfolder- Returns:
- true if the deletion trigger file was successfully created in the hotfolder, false otherwise
- Throws:
IOException- if any.
-
reIndexCMSPage
- Parameters:
page- CMS page to export to the hotfolder for re-indexingaugmenters- list of index augmenters contributing additional data- Returns:
- true if export for reindexing successful; false otherwise
-