mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 18:14:26 +00:00
Update to check Discovery & new Authority indexes in 'ant update_solr_indexes'. Also corrected auto-reindexing of Discovery in Flyway logic, as it needs to both overwrite existing index AND recreate the spellchecker index.
This commit is contained in:
@@ -1068,9 +1068,11 @@ public class DatabaseUtils
|
|||||||
|
|
||||||
log.info("Post database migration, reindexing all content in Discovery search and browse engine");
|
log.info("Post database migration, reindexing all content in Discovery search and browse engine");
|
||||||
|
|
||||||
// Reindex Discovery (just clean & update index)
|
// Reindex Discovery completely
|
||||||
this.indexer.cleanIndex(true);
|
// Recreate the entire index (overwriting existing one)
|
||||||
this.indexer.updateIndex(context, true);
|
this.indexer.createIndex(context);
|
||||||
|
// Rebuild spell checker (which is based on index)
|
||||||
|
this.indexer.buildSpellCheck();
|
||||||
|
|
||||||
// Reset our indexing flag. Indexing is done.
|
// Reset our indexing flag. Indexing is done.
|
||||||
DatabaseUtils.setReindexDiscovery(false);
|
DatabaseUtils.setReindexDiscovery(false);
|
||||||
|
@@ -970,7 +970,7 @@ You may manually install this file by following these steps:
|
|||||||
<if>
|
<if>
|
||||||
<available file="${stats.index}" type="dir"/>
|
<available file="${stats.index}" type="dir"/>
|
||||||
<then>
|
<then>
|
||||||
<!-- Ensure Statistics index is >= 3.5.0 -->
|
<!-- Ensure Statistics index is >= Solr/Lucene 3.5.0 -->
|
||||||
<antcall target="check_solr_index">
|
<antcall target="check_solr_index">
|
||||||
<param name="indexDir" value="${stats.index}"/>
|
<param name="indexDir" value="${stats.index}"/>
|
||||||
<param name="version" value="3.5.0"/>
|
<param name="version" value="3.5.0"/>
|
||||||
@@ -985,12 +985,34 @@ You may manually install this file by following these steps:
|
|||||||
</then>
|
</then>
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
|
<!-- Next, let's do the Discovery Solr index.
|
||||||
|
NOTE: Discovery will be reindexed post database migration, but this
|
||||||
|
is here as a safety measure for older versions of Solr/Lucene -->
|
||||||
|
<property name="discovery.index" value="${dspace.dir}/solr/search/data/index/"/>
|
||||||
|
<if>
|
||||||
|
<available file="${discovery.index}" type="dir"/>
|
||||||
|
<then>
|
||||||
|
<!-- Ensure Discovery index is >= Solr/Lucene 3.5.0 -->
|
||||||
|
<antcall target="check_solr_index">
|
||||||
|
<param name="indexDir" value="${discovery.index}"/>
|
||||||
|
<param name="version" value="3.5.0"/>
|
||||||
|
<param name="included" value="false"/>
|
||||||
|
</antcall>
|
||||||
|
<!-- Ensure Discovery index is upgraded to latest version (included in DSpace) -->
|
||||||
|
<antcall target="check_solr_index">
|
||||||
|
<param name="indexDir" value="${discovery.index}"/>
|
||||||
|
<param name="version" value="${latest_version}"/>
|
||||||
|
<param name="included" value="true"/>
|
||||||
|
</antcall>
|
||||||
|
</then>
|
||||||
|
</if>
|
||||||
|
|
||||||
<!-- Next, let's do the OAI-PMH Solr index -->
|
<!-- Next, let's do the OAI-PMH Solr index -->
|
||||||
<property name="oai.index" value="${dspace.dir}/solr/oai/data/index/"/>
|
<property name="oai.index" value="${dspace.dir}/solr/oai/data/index/"/>
|
||||||
<if>
|
<if>
|
||||||
<available file="${oai.index}" type="dir"/>
|
<available file="${oai.index}" type="dir"/>
|
||||||
<then>
|
<then>
|
||||||
<!-- Ensure OAI index is >= 3.5.0 -->
|
<!-- Ensure OAI index is >= Solr/Lucene 3.5.0 -->
|
||||||
<antcall target="check_solr_index">
|
<antcall target="check_solr_index">
|
||||||
<param name="indexDir" value="${oai.index}"/>
|
<param name="indexDir" value="${oai.index}"/>
|
||||||
<param name="version" value="3.5.0"/>
|
<param name="version" value="3.5.0"/>
|
||||||
@@ -1005,6 +1027,21 @@ You may manually install this file by following these steps:
|
|||||||
</then>
|
</then>
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
|
<!-- Next, let's do the Authority Solr index. This index first appeared
|
||||||
|
in DSpace 5, so it will never be < Solr 3.5.0 -->
|
||||||
|
<property name="authority.index" value="${dspace.dir}/solr/authority/data/index/"/>
|
||||||
|
<if>
|
||||||
|
<available file="${authority.index}" type="dir"/>
|
||||||
|
<then>
|
||||||
|
<!-- Ensure Authority index is upgraded to latest version (included in DSpace) -->
|
||||||
|
<antcall target="check_solr_index">
|
||||||
|
<param name="indexDir" value="${authority.index}"/>
|
||||||
|
<param name="version" value="${latest_version}"/>
|
||||||
|
<param name="included" value="true"/>
|
||||||
|
</antcall>
|
||||||
|
</then>
|
||||||
|
</if>
|
||||||
|
|
||||||
<!-- Finally, cleanup any Lucene JARs that were downloaded into the Ant build directory -->
|
<!-- Finally, cleanup any Lucene JARs that were downloaded into the Ant build directory -->
|
||||||
<!-- (These JARs are automatically downloaded when an index needs an upgrade). -->
|
<!-- (These JARs are automatically downloaded when an index needs an upgrade). -->
|
||||||
<echo>Cleanup any downloaded lucene-core-*.jar files. We don't need them anymore.</echo>
|
<echo>Cleanup any downloaded lucene-core-*.jar files. We don't need them anymore.</echo>
|
||||||
|
Reference in New Issue
Block a user