diff --git a/web/app/controllers/resources/LocalIndex.java b/web/app/controllers/resources/LocalIndex.java index 047952432..31d00e791 100644 --- a/web/app/controllers/resources/LocalIndex.java +++ b/web/app/controllers/resources/LocalIndex.java @@ -13,6 +13,7 @@ import java.nio.file.Paths; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collections; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -30,8 +31,10 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.env.Environment; +import org.elasticsearch.node.InternalSettingsPreparer; import org.elasticsearch.node.Node; import org.elasticsearch.node.NodeValidationException; +import org.xbib.elasticsearch.plugin.bundle.BundlePlugin; import play.Logger; import play.libs.Json; @@ -62,7 +65,7 @@ public LocalIndex() { * Create a new local index based on our test set */ public LocalIndex(String testConfig, String testData, String testDataItems) { - node = new Node(Settings.builder() + node = new LocalNode(Settings.builder() .put(Node.NODE_NAME_SETTING.getKey(), "testNode") .put(NetworkModule.TRANSPORT_TYPE_KEY, NetworkModule.LOCAL_TRANSPORT) .put(NetworkModule.HTTP_ENABLED.getKey(), false) // @@ -179,5 +182,11 @@ private static String config(final String testConfig) { } return res; } + private static class LocalNode extends Node { + private LocalNode(final Settings settings) { + super(InternalSettingsPreparer.prepareEnvironment(settings, null), + Collections.singleton(BundlePlugin.class)); + } + } } diff --git a/web/build.sbt b/web/build.sbt index 19ed2f4c0..9903789c4 100644 --- a/web/build.sbt +++ b/web/build.sbt @@ -18,7 +18,9 @@ libraryDependencies ++= Seq( exclude ("io.netty", "netty"), "org.mockito" % "mockito-core" % "1.9.5", "com.google.gdata" % "core" % "1.47.1" exclude ("com.google.guava", "guava"), - "org.easytesting" % "fest-assert" % "1.4" % "test" + "org.easytesting" % "fest-assert" % "1.4" % "test", + "org.apache.logging.log4j" % "log4j-core" % "2.20.0", + "org.xbib.elasticsearch.plugin" % "elasticsearch-plugin-bundle" % "5.4.1.0" ) resolvers += "Local Maven Repository" at Path.userHome.asFile.toURI.toURL + ".m2/repository" diff --git a/web/test/tests/IndexIntegrationTest.java b/web/test/tests/IndexIntegrationTest.java index 8884c8afd..c4f7f20a4 100644 --- a/web/test/tests/IndexIntegrationTest.java +++ b/web/test/tests/IndexIntegrationTest.java @@ -88,7 +88,9 @@ public static Collection data() { { "describedBy.resultOf.object.dateCreated:\"2023-03-22\"", /*->*/ 1}, { "describedBy.resultOf.object.dateModified:\"2022-07-18\"", /*->*/ 1}, { "describedBy.resultOf.object.sourceOrganization.id:\"http\\://lobid.org/organisations/DE-5#\\!\"", /*->*/ 4}, - { "describedBy.resultOf.object.modifiedBy.id:\"http\\://lobid.org/organisations/DE-6#\\!\"", /*->*/ 13 } + { "describedBy.resultOf.object.modifiedBy.id:\"http\\://lobid.org/organisations/DE-6#\\!\"", /*->*/ 13 }, + { "\"Reader-friendly\"", /*->*/ 1}, + { "\"Reader friendly\"", /*->*/ 1} }); } // @formatter:on