Bug fix to previous commit. Removing 'authority' index from Solr check

as it seems problematic if index is not initialized. Also ensure
Discovery reindex isn't triggered multiple times if an error occurs.
This commit is contained in:
Tim Donohue
2014-11-18 22:34:06 +00:00
parent 0c166a937a
commit 72ae84e144
2 changed files with 6 additions and 17 deletions

View File

@@ -1069,13 +1069,13 @@ public class DatabaseUtils
log.info("Post database migration, reindexing all content in Discovery search and browse engine");
// Reindex Discovery completely
// Force clean all content
this.indexer.cleanIndex(true);
// Recreate the entire index (overwriting existing one)
this.indexer.createIndex(context);
// Rebuild spell checker (which is based on index)
this.indexer.buildSpellCheck();
// Reset our indexing flag. Indexing is done.
DatabaseUtils.setReindexDiscovery(false);
log.info("Reindexing is complete");
}
catch(SearchServiceException sse)
@@ -1088,6 +1088,10 @@ public class DatabaseUtils
}
finally
{
// Reset our indexing flag. Indexing is done or it threw an error,
// Either way, we shouldn't try again.
DatabaseUtils.setReindexDiscovery(false);
// Clean up our context, if it still exists
if(context!=null && context.isValid())
context.abort();

View File

@@ -1027,21 +1027,6 @@ You may manually install this file by following these steps:
</then>
</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 -->
<!-- (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>