Skip to content

Commit 600f430

Browse files
authored
Merge pull request #173 from dadoonet/dependabot/maven/co.elastic.clients-elasticsearch-java-9.1.0
Bump co.elastic.clients:elasticsearch-java from 9.0.3 to 9.1.0
2 parents d541b1c + b1269cd commit 600f430

File tree

3 files changed

+10
-13
lines changed

3 files changed

+10
-13
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ I believe it could be beneficial for many, so I've made the code available here.
1111

1212
You're welcome to contribute your own examples if you'd like.
1313

14-
This repository is tested against Elasticsearch 9.0.3.
14+
This repository is tested against Elasticsearch 9.1.0.
1515

1616
We automatically start a Docker image using the [Elasticsearch module for TestContainers](https://www.testcontainers.org/modules/elasticsearch/).
1717

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
<properties>
1212
<!-- Main dependencies -->
13-
<elasticsearch.version>9.0.3</elasticsearch.version>
13+
<elasticsearch.version>9.1.0</elasticsearch.version>
1414
<jackson.version>2.19.2</jackson.version>
1515
<log4j.version>2.25.1</log4j.version>
1616
<slf4j.version>2.0.17</slf4j.version>

src/test/java/fr/pilato/test/elasticsearch/hlclient/EsClientIT.java

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import co.elastic.clients.elasticsearch.cat.ThreadPoolResponse;
3232
import co.elastic.clients.elasticsearch.cluster.PutComponentTemplateResponse;
3333
import co.elastic.clients.elasticsearch.core.*;
34+
import co.elastic.clients.elasticsearch.core.search.HighlightField;
3435
import co.elastic.clients.elasticsearch.ilm.PutLifecycleResponse;
3536
import co.elastic.clients.elasticsearch.indices.*;
3637
import co.elastic.clients.elasticsearch.ingest.PutPipelineResponse;
@@ -43,6 +44,7 @@
4344
import co.elastic.clients.transport.endpoints.BinaryResponse;
4445
import co.elastic.clients.util.BinaryData;
4546
import co.elastic.clients.util.ContentType;
47+
import co.elastic.clients.util.NamedValue;
4648
import com.fasterxml.jackson.core.type.TypeReference;
4749
import com.fasterxml.jackson.databind.JsonNode;
4850
import com.fasterxml.jackson.databind.ObjectMapper;
@@ -328,7 +330,8 @@ void highlight() throws IOException {
328330
final SearchResponse<Void> response = client.search(sr -> sr
329331
.index(indexName)
330332
.query(q -> q.match(mq -> mq.field("foo").query("bar")))
331-
.highlight(h -> h.fields("foo", hf -> hf.maxAnalyzedOffset(10)))
333+
.highlight(h -> h
334+
.fields(NamedValue.of("foo", HighlightField.of(hf -> hf.maxAnalyzedOffset(10)))))
332335
, Void.class);
333336
assertThat(response.hits().total()).isNotNull();
334337
assertThat(response.hits().total().value()).isEqualTo(1);
@@ -969,22 +972,16 @@ void esql() throws IOException, SQLException {
969972
{
970973
// Using the Raw ES|QL API
971974
try (final BinaryResponse response = client.esql().query(q -> q.query(query)); InputStream is = response.content()) {
972-
// The response object is {
973-
// "took" : 4,
974-
// "is_partial" : false,
975-
// "columns" : [ {
976-
// "name" : "name",
977-
// "type" : "text"
978-
// } ],
979-
// "values" : [ [ "David" ] ]
980-
//}
975+
// The response object is {"took":173,"is_partial":false,"documents_found":1,"values_loaded":1,"columns":[{"name":"name","type":"text"}],"values":[["David"]]}
981976
final ObjectMapper mapper = new ObjectMapper();
982977
final JsonNode jsonNode = mapper.readTree(is);
983-
assertThat(jsonNode).isNotNull().hasSize(4);
978+
assertThat(jsonNode).isNotNull().hasSize(6);
984979
assertThat(jsonNode.get("columns")).isNotNull().hasSize(1).first().satisfies(column -> assertThat(column.get("name").asText()).isEqualTo("name"));
985980
assertThat(jsonNode.get("values")).isNotNull().hasSize(1).first().satisfies(value -> assertThat(value).hasSize(1).first().satisfies(singleValue -> assertThat(singleValue.asText()).isEqualTo("David")));
986981
assertThat(jsonNode.get("took").asInt()).isGreaterThan(0);
987982
assertThat(jsonNode.get("is_partial").asBoolean()).isFalse();
983+
assertThat(jsonNode.get("documents_found").asLong()).isEqualTo(1);
984+
assertThat(jsonNode.get("values_loaded").asLong()).isEqualTo(1);
988985
}
989986
}
990987

0 commit comments

Comments
 (0)