IndexModule: Use lowercase IndexType values consistently

Before this change, the init would fail as reported in the merged
Ia129d3eb's trailing comments.

Change-Id: I55af38995166c2b9f4dbb9fbc6196df083411a89
This commit is contained in:
Marco Miller 2019-05-23 16:10:29 -04:00 committed by Marco Miller
parent 0903cb9f30
commit 1393972509
2 changed files with 6 additions and 6 deletions

View File

@ -74,13 +74,13 @@ import org.eclipse.jgit.lib.Config;
*/
public class IndexModule extends LifecycleModule {
public static class IndexType {
private static final String LUCENE = "LUCENE";
private static final String ELASTICSEARCH = "ELASTICSEARCH";
private static final String LUCENE = "lucene";
private static final String ELASTICSEARCH = "elasticsearch";
private final String type;
public IndexType(@Nullable String type) {
this.type = type == null ? getDefault() : type;
this.type = type == null ? getDefault() : type.toLowerCase();
}
public static String getDefault() {
@ -92,11 +92,11 @@ public class IndexModule extends LifecycleModule {
}
public boolean isLucene() {
return type.equalsIgnoreCase(LUCENE);
return type.equals(LUCENE);
}
public boolean isElasticsearch() {
return type.equalsIgnoreCase(ELASTICSEARCH);
return type.equals(ELASTICSEARCH);
}
@Override

View File

@ -32,7 +32,7 @@ public final class ElasticTestUtils {
}
public static void configure(Config config, int port, String prefix, ElasticVersion version) {
config.setString("index", null, "type", "ELASTICSEARCH");
config.setString("index", null, "type", "elasticsearch");
config.setString("elasticsearch", null, "server", "http://localhost:" + port);
config.setString("elasticsearch", null, "prefix", prefix);
config.setInt("index", null, "maxLimit", 10000);