Skip to content

Commit 679de16

Browse files
committed
Fix ES 8.x compatibility
- Includes Jackson Core dependency - Explicitly disable instrumentation on the plugins RestClient to avoid missing dependencies
1 parent 0868de7 commit 679de16

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,17 @@ If you are planning to use Elasticsearch with Docker, you should build a custom
4848
Dockerfile provided and use it instead
4949

5050
```
51-
docker build --tag=elasticsearch-telicent-plugin:7.17.14 .
51+
docker build --build-arg ELASTICSEARCH_VERSION=8.12.2 \
52+
--build-arg PLUGIN_VERSION=8.12.2.1 \
53+
--tag=elasticsearch-telicent-plugin:8.12.2.1 .
5254
```
5355

5456
This way the plugin will be preinstalled.
5557

5658
Alternatively, you can use Telicent's Elasticsearch image
5759

5860
```
59-
docker pull telicent/elasticsearch
61+
docker pull telicent/elasticsearch:8.12.2.1
6062
```
6163

6264
## Getting Started

pom.xml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55
<modelVersion>4.0.0</modelVersion>
66
<groupId>io.telicent.elasticsearch</groupId>
77
<artifactId>SynonymsPlugin</artifactId>
8-
<version>8.12.2.0</version>
8+
<version>8.12.2.1</version>
99
<description>A plugin for ElasticSearch providing an index-backed synonym
1010
handler
1111
</description>
1212
<properties>
1313
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
14-
<elasticsearch.version>8.12.2</elasticsearch.version>
14+
<elasticsearch.version>8.12.2</elasticsearch.version>
1515
<jdk.version>17</jdk.version>
1616
<testcontainer.version>1.19.2</testcontainer.version>
17-
<jackson.core.version>2.16.1</jackson.core.version>
18-
<jackson.databind.version>2.16.1</jackson.databind.version>
17+
<jackson.core.version>2.17.0</jackson.core.version>
18+
<jackson.databind.version>2.17.0</jackson.databind.version>
1919
<git-code-format-maven-plugin.version>4.3</git-code-format-maven-plugin.version>
2020
</properties>
2121
<build>
@@ -123,13 +123,11 @@
123123
<groupId>com.fasterxml.jackson.core</groupId>
124124
<artifactId>jackson-core</artifactId>
125125
<version>${jackson.core.version}</version>
126-
<scope>provided</scope> <!-- Provided by Elasticsearch -->
127126
</dependency>
128127
<dependency>
129128
<groupId>com.fasterxml.jackson.core</groupId>
130129
<artifactId>jackson-databind</artifactId>
131130
<version>${jackson.databind.version}</version>
132-
<scope>compile</scope> <!-- Not provided by Elasticsearch -->
133131
</dependency>
134132
<dependency>
135133
<groupId>org.elasticsearch</groupId>

src/main/java/io/telicent/elasticsearch/IndexedSynonymParser.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import co.elastic.clients.elasticsearch.core.search.Hit;
1919
import co.elastic.clients.json.jackson.JacksonJsonpMapper;
2020
import co.elastic.clients.transport.ElasticsearchTransport;
21+
import co.elastic.clients.transport.instrumentation.NoopInstrumentation;
2122
import co.elastic.clients.transport.rest_client.RestClientTransport;
2223
import com.fasterxml.jackson.databind.JsonNode;
2324
import com.fasterxml.jackson.databind.node.ArrayNode;
@@ -144,7 +145,11 @@ public HttpAsyncClientBuilder customizeHttpClient(
144145

145146
// Create the transport with a Jackson mapper
146147
final ElasticsearchTransport transport =
147-
new RestClientTransport(builder.build(), new JacksonJsonpMapper());
148+
new RestClientTransport(
149+
builder.build(),
150+
new JacksonJsonpMapper(),
151+
null,
152+
NoopInstrumentation.INSTANCE);
148153

149154
// And create the API client
150155
final ElasticsearchClient client = new ElasticsearchClient(transport);

0 commit comments

Comments
 (0)