Skip to content
This repository was archived by the owner on Jul 14, 2023. It is now read-only.

Commit 022fc44

Browse files
authored
Merge pull request #2184 from AndrewZWood/DS-3658
DS-3658 Configure ReindexerThread disable reindex
2 parents 2ffa8ed + 7253095 commit 022fc44

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

dspace-api/src/main/java/org/dspace/storage/rdbms/DatabaseUtils.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1244,14 +1244,13 @@ public static synchronized void setReindexDiscovery(boolean reindex)
12441244
* <P>
12451245
* Because the DB migration may be initialized by commandline or any one of
12461246
* the many DSpace webapps, this checks for the existence of a temporary
1247-
* file to know when Discovery/Solr needs reindexing.
1248-
* @return whether reindex flag is true/false
1247+
* file, and the discovery.autoReindex setting to know when Discovery/Solr needs reindexing.
1248+
* @return whether reindexing should happen.
12491249
*/
12501250
public static boolean getReindexDiscovery()
12511251
{
1252-
// Simply check if the flag file exists
1253-
File reindexFlag = new File(reindexDiscoveryFilePath);
1254-
return reindexFlag.exists();
1252+
boolean autoReindex = DSpaceServicesFactory.getInstance().getConfigurationService().getBooleanProperty("discovery.autoReindex", true);
1253+
return (autoReindex && new File(reindexDiscoveryFilePath).exists());
12551254
}
12561255

12571256
/**

dspace/config/modules/discovery.cfg

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,10 @@ discovery.index.projection=dc.title,dc.contributor.*,dc.date.issued
2222
# 1) you need to set the DiscoverySearchRequestProcessor in the dspace.cfg
2323
# 2) to show facet on Site/Community/etc. you need to add a Site/Community/Collection
2424
# Processors plugin in the dspace.cfg
25+
26+
# Allow auto-reindexing
27+
# When enabled, if any database migrations are applied to your database (via Flyway), then a reindex flag
28+
# is written to [dspace]/solr/search/conf/reindex.flag. Whenever the DSpace webapp is (re)started, it checks
29+
# for the existence of that file. If found, a background reindex of all content is triggered in Discovery.
30+
# Defaults to true: auto-reindexing is enabled.
31+
#discovery.autoReindex = true

0 commit comments

Comments
 (0)