Skip to content

Commit

Permalink
Merge pull request #1317 from b2ihealthcare/upgrade/elasticsearch8-cl…
Browse files Browse the repository at this point in the history
…ient

Bump Elasticsearch 8 client to 8.15.0
  • Loading branch information
cmark authored Aug 16, 2024
2 parents d82354f + 915849c commit 5b56eae
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 14 deletions.
4 changes: 2 additions & 2 deletions commons/com.b2international.index.es8/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry exported="true" kind="lib" path="lib/elasticsearch-java-8.12.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/elasticsearch-rest-client-8.12.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/elasticsearch-java-8.15.0.jar"/>
<classpathentry exported="true" kind="lib" path="lib/elasticsearch-rest-client-8.15.0.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jakarta.json-api-2.0.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/opentelemetry-api-1.29.0.jar"/>
<classpathentry exported="true" kind="lib" path="lib/opentelemetry-context-1.29.0.jar"/>
Expand Down
8 changes: 4 additions & 4 deletions commons/com.b2international.index.es8/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="3.9.0",
org.apache.httpcomponents.httpcore;bundle-version="[4.4.16,4.4.17)",
org.apache.commons.commons-codec;bundle-version="1.16.0"
Bundle-ClassPath: .,
lib/elasticsearch-java-8.12.2.jar,
lib/elasticsearch-rest-client-8.12.2.jar,
lib/elasticsearch-java-8.15.0.jar,
lib/elasticsearch-rest-client-8.15.0.jar,
lib/jakarta.json-api-2.0.2.jar,
lib/opentelemetry-api-1.29.0.jar,
lib/opentelemetry-context-1.29.0.jar,
Expand Down Expand Up @@ -100,6 +100,7 @@ Export-Package: co.elastic.clients,
co.elastic.clients.elasticsearch.enrich.stats,
co.elastic.clients.elasticsearch.eql,
co.elastic.clients.elasticsearch.eql.search,
co.elastic.clients.elasticsearch.esql,
co.elastic.clients.elasticsearch.features,
co.elastic.clients.elasticsearch.fleet,
co.elastic.clients.elasticsearch.graph,
Expand Down Expand Up @@ -133,6 +134,7 @@ Export-Package: co.elastic.clients,
co.elastic.clients.elasticsearch.indices.stats,
co.elastic.clients.elasticsearch.indices.update_aliases,
co.elastic.clients.elasticsearch.indices.validate_query,
co.elastic.clients.elasticsearch.inference,
co.elastic.clients.elasticsearch.ingest,
co.elastic.clients.elasticsearch.ingest.geo_ip_stats,
co.elastic.clients.elasticsearch.ingest.simulate,
Expand Down Expand Up @@ -160,8 +162,6 @@ Export-Package: co.elastic.clients,
co.elastic.clients.elasticsearch.nodes.reload_secure_settings,
co.elastic.clients.elasticsearch.nodes.stats,
co.elastic.clients.elasticsearch.nodes.usage,
co.elastic.clients.elasticsearch.query_ruleset,
co.elastic.clients.elasticsearch.query_ruleset.list,
co.elastic.clients.elasticsearch.rollup,
co.elastic.clients.elasticsearch.rollup.get_jobs,
co.elastic.clients.elasticsearch.rollup.get_rollup_caps,
Expand Down
2 changes: 1 addition & 1 deletion commons/com.b2international.index.es8/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</parent>

<properties>
<elasticsearch8.version>8.12.2</elasticsearch8.version>
<elasticsearch8.version>8.15.0</elasticsearch8.version>
</properties>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public final class IndexResource extends ExternalResource {
*/
public static final String ES_USE_TEST_CONTAINER_VARIABLE = "so.index.es.useDocker";

public static final String DEFAULT_ES_DOCKER_IMAGE = "docker.elastic.co/elasticsearch/elasticsearch:8.12.2";
public static final String DEFAULT_ES_DOCKER_IMAGE = "docker.elastic.co/elasticsearch/elasticsearch:8.15.0";

private static final AtomicBoolean INIT = new AtomicBoolean(false);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,12 @@ private void visit(Expression expression) {

private void visit(ScriptQueryExpression expression) {
Script esScript = expression.toEsScript(mapping);
deque.push(QueryBuilders.script(script -> script.boost(this.boost).script(s -> s.inline(in -> in
deque.push(QueryBuilders.script(script -> script.boost(this.boost).script(s -> s
.lang(esScript.getLang())
.source(esScript.getIdOrCode())
.options(esScript.getOptions())
.params(Maps.transformValues(esScript.getParams(), JsonData::of))
))));
)));
}

private void visit(ScriptScoreExpression expression) {
Expand All @@ -180,11 +180,11 @@ private void visit(ScriptScoreExpression expression) {
.functions(
FunctionScoreBuilders.scriptScore(
scriptScore -> scriptScore.script(
s -> s.inline(in -> in
s -> s
.lang(esScript.getLang())
.source(esScript.getIdOrCode())
.options(esScript.getOptions())
.params(Maps.transformValues(esScript.getParams(), JsonData::of))
.params(Maps.transformValues(esScript.getParams(), JsonData::of)
)
)
)
Expand Down Expand Up @@ -478,7 +478,8 @@ private void visit(WildcardPredicate wildcard) {
}

private void visit(RangePredicate<?> range) {
deque.push(QueryBuilders.range(r -> {
// TODO consider typed range query, is there a benefit?
deque.push(QueryBuilders.range(q -> q.untyped(r -> {
r.boost(this.boost);
if (range.lower() != null) {
final Object lower = range.lower() instanceof BigDecimal ? DecimalUtils.encode((BigDecimal) range.lower()) : range.lower();
Expand All @@ -497,7 +498,7 @@ private void visit(RangePredicate<?> range) {
}
}
return r.field(toFieldPath(range));
}));
})));
}

private void visit(DisMaxPredicate dismax) {
Expand Down

0 comments on commit 5b56eae

Please sign in to comment.