Skip to content

Commit 1e32181

Browse files
committed
Update Elasticsearch to v8.19.11
1 parent 7906a2b commit 1e32181

File tree

6 files changed

+20
-33
lines changed

6 files changed

+20
-33
lines changed

core/src/main/java/org/fao/geonet/kernel/search/EsSearchManager.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2001-2025 Food and Agriculture Organization of the
2+
* Copyright (C) 2001-2026 Food and Agriculture Organization of the
33
* United Nations (FAO-UN), United Nations World Food Programme (WFP)
44
* and United Nations Environment Programme (UNEP)
55
*
@@ -375,13 +375,12 @@ public BulkResponse updateFields(String id, Map<String, Object> fieldMap, Set<St
375375
.scriptedUpsert(true)
376376
.upsert(Map.of())
377377
.script(script -> script
378-
.inline(inlineScript -> inlineScript
379-
.lang("painless")
380-
.source(scriptSource.toString())
381-
)
378+
.source(scriptSource.toString())
379+
.lang("painless")
382380
)
383381
)
384-
);
382+
);
383+
385384

386385
UpdateOperation addFieldRequestOperation = UpdateOperation.of(
387386
b -> b.id(id)

es/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ These configurations should not be used for a production deployment.
1111
1. Use docker pull to download the image (you can check version in the :file:`pom.xml` file):
1212

1313
```
14-
docker pull docker.elastic.co/elasticsearch/elasticsearch:8.14.3
14+
docker pull docker.elastic.co/elasticsearch/elasticsearch:8.19.11
1515
```
1616

1717
2. Use docker run, leaving 9200 available:
@@ -21,7 +21,7 @@ These configurations should not be used for a production deployment.
2121
-e "discovery.type=single-node" \
2222
-e "xpack.security.enabled=false" \
2323
-e "xpack.security.enrollment.enabled=false" \
24-
docker.elastic.co/elasticsearch/elasticsearch:8.14.3
24+
docker.elastic.co/elasticsearch/elasticsearch:8.19.11
2525
```
2626

2727
3. Check that elasticsearch is running by visiting http://localhost:9200 in a browser
@@ -61,8 +61,8 @@ Maven installation ensure you always are using the ``es.version`` version specif
6161

6262
## Manual installation
6363

64-
1. Download Elasticsearch 8.14.3 from https://www.elastic.co/downloads/elasticsearch
65-
and copy to the ES module, e.g., ``es/elasticsearch-8.14.3`
64+
1. Download Elasticsearch 8.19.11 from https://www.elastic.co/downloads/elasticsearch
65+
and copy to the ES module, e.g., ``es/elasticsearch-8.19.11`
6666

6767
2. Disable the security
6868

@@ -127,7 +127,7 @@ Don't hesitate to propose a Pull Request with the new language.
127127

128128
1. Configure ES to start on server startup. It is recommended to protect `gn-records` index from the Internet access.
129129

130-
* Note that for debian-based servers the current deb download (8.14.3) can be installed rather than installing manually and can be configured to run as a service using the instructions here: https://www.elastic.co/guide/en/elasticsearch/reference/current/starting-elasticsearch.html
130+
* Note that for debian-based servers the current deb download (8.19.11) can be installed rather than installing manually and can be configured to run as a service using the instructions here: https://www.elastic.co/guide/en/elasticsearch/reference/current/starting-elasticsearch.html
131131

132132

133133
# Troubleshoot

es/docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: '3'
22

33
services:
44
elasticsearch:
5-
image: docker.elastic.co/elasticsearch/elasticsearch:8.14.3
5+
image: docker.elastic.co/elasticsearch/elasticsearch:8.19.11
66
container_name: elasticsearch8
77
environment:
88
- cluster.name=docker-cluster
@@ -20,7 +20,7 @@ services:
2020
ports:
2121
- "9200:9200"
2222
kibana:
23-
image: docker.elastic.co/kibana/kibana:8.14.3
23+
image: docker.elastic.co/kibana/kibana:8.19.11
2424
container_name: kibana8
2525
ports:
2626
- "5601:5601"

es/es-dashboards/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040
## Manual installation
4141

42-
1. Download Kibana 8.14.3 from https://www.elastic.co/downloads/kibana
42+
1. Download Kibana 8.19.11 from https://www.elastic.co/downloads/kibana
4343

4444
2. Set Kibana base path and index name in config/kibana.yml:
4545

@@ -81,7 +81,7 @@ Visit Kibana in a browser using one of the above links and go to 'Saved Objects'
8181

8282
### Production Use
8383

84-
Kibana can be installed from the debian files, and Kibana 8.14.3 is confirmed as working with Geonetwork 4.4.x.
84+
Kibana can be installed from the debian files, and Kibana 8.19.11 is confirmed as working with Geonetwork 4.4.x.
8585

8686
Set Kibana to start when the server starts up, using the instructions at https://www.elastic.co/guide/en/kibana/current/start-stop.html
8787

index/src/main/java/org/fao/geonet/index/es/EsRestClient.java

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2001-2023 Food and Agriculture Organization of the
2+
* Copyright (C) 2001-2026 Food and Agriculture Organization of the
33
* United Nations (FAO-UN), United Nations World Food Programme (WFP)
44
* and United Nations Environment Programme (UNEP)
55
*
@@ -56,6 +56,7 @@
5656
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
5757
import org.apache.http.conn.ssl.TrustStrategy;
5858
import org.apache.http.impl.client.BasicCredentialsProvider;
59+
import org.apache.http.impl.nio.client.HttpAsyncClientBuilder;
5960
import org.apache.http.nio.conn.SchemeIOSessionStrategy;
6061
import org.apache.http.nio.conn.ssl.SSLIOSessionStrategy;
6162
import org.apache.http.ssl.SSLContextBuilder;
@@ -171,7 +172,7 @@ public boolean isTrusted(X509Certificate[] arg0, String arg1) throws Certificate
171172

172173
builder.setHttpClientConfigCallback(httpClientBuilder -> httpClientBuilder.useSystemProperties().setDefaultCredentialsProvider(credentialsProvider));
173174
} else {
174-
builder.setHttpClientConfigCallback(httpClientBuilder -> httpClientBuilder.useSystemProperties());
175+
builder.setHttpClientConfigCallback(HttpAsyncClientBuilder::useSystemProperties);
175176
}
176177
}
177178

@@ -235,10 +236,7 @@ public BulkResponse bulkRequest(String index, Map<String, String> docs) throws I
235236
JsonpMapper jsonpMapper = client._transport().jsonpMapper();
236237
JsonProvider jsonProvider = jsonpMapper.jsonProvider();
237238

238-
Iterator<Map.Entry<String, String>> iterator = docs.entrySet().iterator();
239-
while (iterator.hasNext()) {
240-
Map.Entry<String, String> entry = iterator.next();
241-
239+
for (Map.Entry<String, String> entry : docs.entrySet()) {
242240
JsonData jd = JsonData.from(jsonProvider.createParser(new StringReader(entry.getValue())), jsonpMapper);
243241

244242
requestBuilder
@@ -257,16 +255,6 @@ public BulkResponse bulkRequest(String index, Map<String, String> docs) throws I
257255
}
258256
}
259257

260-
//
261-
// public void bulkRequestAsync(Bulk.Builder bulk , JestResultHandler<BulkResult> handler) {
262-
// client.executeAsync(bulk.build(), handler);
263-
//
264-
// }
265-
//
266-
// public BulkResult bulkRequestSync(Bulk.Builder bulk) throws IOException {
267-
// return client.execute(bulk.build());
268-
// }
269-
270258

271259
/**
272260
* Query using Lucene query syntax.
@@ -348,7 +336,7 @@ public SearchResponse query(String index, Query.Builder queryBuilder, Query.Buil
348336
if (MapUtils.isNotEmpty(scriptedFields)) {
349337
for (Map.Entry<String, String> scriptedField: scriptedFields.entrySet()) {
350338
ScriptField scriptField = ScriptField.of(
351-
b -> b.script(sb -> sb.inline(is -> is.source(scriptedField.getValue())))
339+
b -> b.script(sb -> sb.source(scriptedField.getValue()))
352340
);
353341

354342
searchRequestBuilder.scriptFields(scriptedField.getKey(), scriptField);

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1598,7 +1598,7 @@
15981598
<jetty.port>8080</jetty.port>
15991599
<jetty.stop.port>8090</jetty.stop.port>
16001600

1601-
<es.version>8.14.3</es.version>
1601+
<es.version>8.19.11</es.version>
16021602
<es.platform>linux-x86_64</es.platform>
16031603
<es.installer.extension>tar.gz</es.installer.extension>
16041604
<es.protocol>http</es.protocol>

0 commit comments

Comments
 (0)