Skip to content
Open
Show file tree
Hide file tree
Changes from 6 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
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2001-2025 Food and Agriculture Organization of the
* Copyright (C) 2001-2026 Food and Agriculture Organization of the
* United Nations (FAO-UN), United Nations World Food Programme (WFP)
* and United Nations Environment Programme (UNEP)
*
Expand Down Expand Up @@ -375,13 +375,12 @@ public BulkResponse updateFields(String id, Map<String, Object> fieldMap, Set<St
.scriptedUpsert(true)
.upsert(Map.of())
.script(script -> script
.inline(inlineScript -> inlineScript
.lang("painless")
.source(scriptSource.toString())
)
.source(scriptSource.toString())
.lang("painless")
)
)
);
);


UpdateOperation addFieldRequestOperation = UpdateOperation.of(
b -> b.id(id)
Expand Down
14 changes: 7 additions & 7 deletions docs/manual/docs/install-guide/installing-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ GeoNetwork requires an [Elasticsearch](https://www.elastic.co/products/elasticse

## Elasticsearch compatibility

Elasticsearch Java client version: 8.14.3
Elasticsearch Java client version: 8.19.11

| Elasticsearch Version | Compatibility |
|-----------------------| ------------- |
| Elasticsearch 8.14.3 | recommended |
| Elasticsearch 8.19.11 | recommended |
| Elasticsearch 8.14.x | minimum |

Older version may be supported but are untested.
Expand All @@ -21,23 +21,23 @@ Older version may be supported but are untested.

=== "Manual installation"

1. **Download:** Elasticsearch `8.14.3` from <https://www.elastic.co/downloads/elasticsearch> and unzip the file.
1. **Download:** Elasticsearch `8.19.11` from <https://www.elastic.co/downloads/elasticsearch> and unzip the file.

``` shell
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.14.3.tar.gz
tar xvfz elasticsearch-8.14.3.tar.gz
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.19.11.tar.gz
tar xvfz elasticsearch-8.19.11.tar.gz
```

2. **Start**: Manually start Elasticsearch using:

``` shell
elasticsearch-8.14.3/bin/elasticsearch
elasticsearch-8.19.11/bin/elasticsearch
```

3. **Stop**: Manually stop Elasticsearch using:

``` shell
elasticsearch-8.14.3/bin/elasticsearch stop
elasticsearch-8.19.11/bin/elasticsearch stop
```

=== "Install using Maven"
Expand Down
10 changes: 5 additions & 5 deletions es/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ These configurations should not be used for a production deployment.
1. Use docker pull to download the image (you can check version in the :file:`pom.xml` file):

```
docker pull docker.elastic.co/elasticsearch/elasticsearch:8.14.3
docker pull docker.elastic.co/elasticsearch/elasticsearch:8.19.13
```

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

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

## Manual installation

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

2. Disable the security

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

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

* 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
* Note that for debian-based servers the current deb download (8.19.13) 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


# Troubleshoot
Expand Down
4 changes: 2 additions & 2 deletions es/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3'

services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.14.3
image: docker.elastic.co/elasticsearch/elasticsearch:8.19.13
container_name: elasticsearch8
environment:
- cluster.name=docker-cluster
Expand All @@ -20,7 +20,7 @@ services:
ports:
- "9200:9200"
kibana:
image: docker.elastic.co/kibana/kibana:8.14.3
image: docker.elastic.co/kibana/kibana:8.19.13
container_name: kibana8
ports:
- "5601:5601"
4 changes: 2 additions & 2 deletions es/es-dashboards/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

## Manual installation

1. Download Kibana 8.14.3 from https://www.elastic.co/downloads/kibana
1. Download Kibana 8.19.13 from https://www.elastic.co/downloads/kibana

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

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

### Production Use

Kibana can be installed from the debian files, and Kibana 8.14.3 is confirmed as working with Geonetwork 4.4.x.
Kibana can be installed from the debian files, and Kibana 8.19.13 is confirmed as working with Geonetwork 4.4.x.

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

Expand Down
10 changes: 5 additions & 5 deletions es/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
esVersion = "${es.version}";
print("Scanning README for " + esVersion);

docker = Pattern.compile("elasticsearch:(\\d.\\d\\d.\\d)");
download = Pattern.compile("Download Elasticsearch (\\d.\\d\\d.\\d)");
folder = Pattern.compile("es/elasticsearch-(\\d.\\d\\d.\\d)");
docker = Pattern.compile("elasticsearch:(\\d+\\.\\d+\\.\\d+)");
download = Pattern.compile("Download Elasticsearch (\\d+\\.\\d+\\.\\d+)");
folder = Pattern.compile("es/elasticsearch-(\\d+\\.\\d+\\.\\d+)");

patterns = new Pattern[]{ docker, download, folder};

Expand Down Expand Up @@ -77,8 +77,8 @@
esVersion = "${es.version}";
print("Scanning "+filename+" for " + esVersion);

docker = Pattern.compile("elasticsearch:(\\d.\\d\\d.\\d)");
kibana = Pattern.compile("kibana:(\\d.\\d\\d.\\d)");
docker = Pattern.compile("elasticsearch:(\\d\\d+.\\d\\d+.\\d\\d+)");
kibana = Pattern.compile("kibana:(\\d\\d+.\\d\\d+.\\d\\d+)");
patterns = new Pattern[]{ docker, kibana};

String baseDir = new File(java.net.URI.create("${project.baseUri}")).getAbsolutePath().toString();
Expand Down
22 changes: 5 additions & 17 deletions index/src/main/java/org/fao/geonet/index/es/EsRestClient.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2001-2023 Food and Agriculture Organization of the
* Copyright (C) 2001-2026 Food and Agriculture Organization of the
* United Nations (FAO-UN), United Nations World Food Programme (WFP)
* and United Nations Environment Programme (UNEP)
*
Expand Down Expand Up @@ -56,6 +56,7 @@
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.conn.ssl.TrustStrategy;
import org.apache.http.impl.client.BasicCredentialsProvider;
import org.apache.http.impl.nio.client.HttpAsyncClientBuilder;
import org.apache.http.nio.conn.SchemeIOSessionStrategy;
import org.apache.http.nio.conn.ssl.SSLIOSessionStrategy;
import org.apache.http.ssl.SSLContextBuilder;
Expand Down Expand Up @@ -171,7 +172,7 @@ public boolean isTrusted(X509Certificate[] arg0, String arg1) throws Certificate

builder.setHttpClientConfigCallback(httpClientBuilder -> httpClientBuilder.useSystemProperties().setDefaultCredentialsProvider(credentialsProvider));
} else {
builder.setHttpClientConfigCallback(httpClientBuilder -> httpClientBuilder.useSystemProperties());
builder.setHttpClientConfigCallback(HttpAsyncClientBuilder::useSystemProperties);
}
}

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

Iterator<Map.Entry<String, String>> iterator = docs.entrySet().iterator();
while (iterator.hasNext()) {
Map.Entry<String, String> entry = iterator.next();

for (Map.Entry<String, String> entry : docs.entrySet()) {
JsonData jd = JsonData.from(jsonProvider.createParser(new StringReader(entry.getValue())), jsonpMapper);

requestBuilder
Expand All @@ -257,16 +255,6 @@ public BulkResponse bulkRequest(String index, Map<String, String> docs) throws I
}
}

//
// public void bulkRequestAsync(Bulk.Builder bulk , JestResultHandler<BulkResult> handler) {
// client.executeAsync(bulk.build(), handler);
//
// }
//
// public BulkResult bulkRequestSync(Bulk.Builder bulk) throws IOException {
// return client.execute(bulk.build());
// }


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

searchRequestBuilder.scriptFields(scriptedField.getKey(), scriptField);
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1598,7 +1598,7 @@
<jetty.port>8080</jetty.port>
<jetty.stop.port>8090</jetty.stop.port>

<es.version>8.14.3</es.version>
<es.version>8.19.13</es.version>
<es.platform>linux-x86_64</es.platform>
<es.installer.extension>tar.gz</es.installer.extension>
<es.protocol>http</es.protocol>
Expand Down
Loading