From 222c9f87120a09d9ad43177e853811796457a323 Mon Sep 17 00:00:00 2001 From: Claudio Pacchiega Date: Fri, 18 Dec 2015 16:13:01 +0100 Subject: [PATCH] Improving message when needing to reindex Old message was just telling to "run Reindex". For newbie it is difficult to understand that the correct thing to do is running gerrit.war with option reindex. Change-Id: I90defeabcceaa6d8b8d7f89bf45662bcbab9ae95 --- .../google/gerrit/lucene/LuceneVersionManager.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/gerrit-lucene/src/main/java/com/google/gerrit/lucene/LuceneVersionManager.java b/gerrit-lucene/src/main/java/com/google/gerrit/lucene/LuceneVersionManager.java index 407f5a82cc..95035fcd84 100644 --- a/gerrit-lucene/src/main/java/com/google/gerrit/lucene/LuceneVersionManager.java +++ b/gerrit-lucene/src/main/java/com/google/gerrit/lucene/LuceneVersionManager.java @@ -113,6 +113,11 @@ public class LuceneVersionManager implements LifecycleListener { @Override public void start() { + String runReindex = + "No index versions ready; run java -jar " + + sitePaths.gerrit_war.toAbsolutePath() + + " reindex"; + FileBasedConfig cfg; try { cfg = loadGerritIndexConfig(sitePaths); @@ -121,10 +126,10 @@ public class LuceneVersionManager implements LifecycleListener { } if (!Files.exists(sitePaths.index_dir)) { - throw new ProvisionException("No index versions ready; run Reindex"); + throw new ProvisionException(runReindex); } else if (!Files.exists(sitePaths.index_dir)) { log.warn("Not a directory: %s", sitePaths.index_dir.toAbsolutePath()); - throw new ProvisionException("No index versions ready; run Reindex"); + throw new ProvisionException(runReindex); } TreeMap versions = scanVersions(cfg); @@ -148,7 +153,7 @@ public class LuceneVersionManager implements LifecycleListener { } } if (search == null) { - throw new ProvisionException("No index versions ready; run Reindex"); + throw new ProvisionException(runReindex); } markNotReady(cfg, versions.values(), write);