Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install elasticsearch plugin bundle #1812

Merged
merged 2 commits into from
Jul 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion web/app/controllers/resources/LocalIndex.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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) //
Expand Down Expand Up @@ -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));
}
}

}
4 changes: 3 additions & 1 deletion web/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 3 additions & 1 deletion web/test/tests/IndexIntegrationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ public static Collection<Object[]> 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

Expand Down