Skip to content

Commit

Permalink
Update to Elasticsearch 8.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
spinscale committed Jun 28, 2022
1 parent ee93f48 commit 1f2b18c
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM docker.elastic.co/elasticsearch/elasticsearch:8.2.3
FROM docker.elastic.co/elasticsearch/elasticsearch:8.3.0

ADD ./src/test/resources/models/en-ner-persons.bin /usr/share/elasticsearch/config/ingest-opennlp/
ADD ./src/test/resources/models/en-ner-locations.bin /usr/share/elasticsearch/config/ingest-opennlp/
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ This plugin is also intended to show you, that using gradle as a build system ma

| ES | Command |
| ----- | ------- |
| 8.3.0 | `bin/elasticsearch-plugin install https://github.com/spinscale/elasticsearch-ingest-opennlp/releases/download/8.3.0.1/ingest-opennlp-8.3.0.1.zip` |
| 8.2.3 | `bin/elasticsearch-plugin install https://github.com/spinscale/elasticsearch-ingest-opennlp/releases/download/8.2.3.1/ingest-opennlp-8.2.3.1.zip` |
| 8.2.2 | `bin/elasticsearch-plugin install https://github.com/spinscale/elasticsearch-ingest-opennlp/releases/download/8.2.2.1/ingest-opennlp-8.2.2.1.zip` |
| 8.2.1 | `bin/elasticsearch-plugin install https://github.com/spinscale/elasticsearch-ingest-opennlp/releases/download/8.2.1.1/ingest-opennlp-8.2.0.1.zip` |
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ dependencies {
compileOnly "org.elasticsearch:elasticsearch:$elasticsearchVersion"

testImplementation "org.elasticsearch:elasticsearch:$elasticsearchVersion"
testImplementation 'co.elastic.clients:elasticsearch-java:8.2.0'
testImplementation "co.elastic.clients:elasticsearch-java:$elasticsearchVersion"
testImplementation 'com.fasterxml.jackson.core:jackson-databind:2.12.3'
testImplementation('org.testcontainers:elasticsearch:1.17.1') {
exclude group: 'junit', module: 'junit'
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
elasticsearchVersion = 8.2.3
elasticsearchVersion = 8.3.0
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@
package de.spinscale.elasticsearch.ingest.opennlp;

import joptsimple.OptionSet;
import org.elasticsearch.common.cli.EnvironmentAwareCommand;
import org.elasticsearch.cli.SuppressForbidden;
import org.elasticsearch.cli.ProcessInfo;
import org.elasticsearch.cli.Terminal;
import org.elasticsearch.common.cli.EnvironmentAwareCommand;
import org.elasticsearch.core.SuppressForbidden;
import org.elasticsearch.env.Environment;

import java.io.InputStream;
Expand All @@ -32,15 +33,15 @@
public class OpenNlpModelDownloader extends EnvironmentAwareCommand {

public static void main(String[] args) throws Exception {
exit(new OpenNlpModelDownloader().main(args, Terminal.DEFAULT));
exit(new OpenNlpModelDownloader().main(args, Terminal.DEFAULT, ProcessInfo.fromSystem()));
}

public OpenNlpModelDownloader() {
super("Downloads three sample models for named entity recognition for dates, locations and persons");
}

@Override
protected void execute(Terminal terminal, OptionSet options, Environment env) throws Exception {
public void execute(Terminal terminal, OptionSet options, Environment env, ProcessInfo processInfo) throws Exception {
Path configDirectoryPath = env.configFile().resolve(IngestOpenNlpPlugin.NAME).normalize().toAbsolutePath();
if (Files.exists(configDirectoryPath) == false) {
Files.createDirectories(configDirectoryPath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public static void startContainer() {
container.addEnv("discovery.type", "single-node");
container.withEnv("xpack.security.enabled", "false");
container.addExposedPorts(9200);
container.setWaitStrategy(new LogMessageWaitStrategy().withRegEx(".*(\"message\":\\s?\"started\".*|] started\n$)"));
container.setWaitStrategy(new LogMessageWaitStrategy().withRegEx(".*(\"message\":\\s?\"started[\\s?|\"].*|] started\n$)"));

container.start();
container.followOutput(new Slf4jLogConsumer(LoggerFactory.getLogger(OpenNlpPluginIntegrationTests.class)));
Expand Down

0 comments on commit 1f2b18c

Please sign in to comment.