mirror of
https://github.com/spring-projects/spring-data-elasticsearch.git
synced 2025-07-28 13:13:26 +00:00
Polishing
Signed-off-by: Peter-Josef Meisch <pj.meisch@sothawo.com>
This commit is contained in:
parent
7f7cf3f52e
commit
e64d0ada62
@ -8,6 +8,8 @@ This section describes breaking changes from version 5.5.x to 6.0.x and how remo
|
|||||||
|
|
||||||
From version 6.0 on, Spring Data Elasticsearch uses the Elasticsearch 9 libraries and as default the new `Rest5Client` provided by these libraries. It is still possible to use the old `RestClient`, check xref:elasticsearch/clients.adoc[Elasticsearch clients] for information. The configuration callbacks for this `RestClient` have been moved from `org.springframework.data.elasticsearch.client.elc.ElasticsearchClients` to the `org.springframework.data.elasticsearch.client.elc.rest_client.RestClients` class.
|
From version 6.0 on, Spring Data Elasticsearch uses the Elasticsearch 9 libraries and as default the new `Rest5Client` provided by these libraries. It is still possible to use the old `RestClient`, check xref:elasticsearch/clients.adoc[Elasticsearch clients] for information. The configuration callbacks for this `RestClient` have been moved from `org.springframework.data.elasticsearch.client.elc.ElasticsearchClients` to the `org.springframework.data.elasticsearch.client.elc.rest_client.RestClients` class.
|
||||||
|
|
||||||
|
In the `org.springframework.data.elasticsearch.core.query.UpdateQuery` class the type of the two fields `ifSeqNo` and `ifPrimaryTerm` has changed from `Integer` to `Long` to align with the normal query and the underlying Elasticsearch client.
|
||||||
|
|
||||||
[[elasticsearch-migration-guide-5.5-6.0.deprecations]]
|
[[elasticsearch-migration-guide-5.5-6.0.deprecations]]
|
||||||
== Deprecations
|
== Deprecations
|
||||||
|
|
||||||
|
@ -723,12 +723,11 @@ class RequestConverter extends AbstractQueryProcessor {
|
|||||||
return a;
|
return a;
|
||||||
});
|
});
|
||||||
|
|
||||||
uob //
|
uob
|
||||||
.routing(query.getRouting()) //
|
.routing(query.getRouting())
|
||||||
.ifSeqNo(query.getIfSeqNo() != null ? Long.valueOf(query.getIfSeqNo()) : null) //
|
.ifSeqNo(query.getIfSeqNo())
|
||||||
.ifPrimaryTerm(query.getIfPrimaryTerm() != null ? Long.valueOf(query.getIfPrimaryTerm()) : null) //
|
.ifPrimaryTerm(query.getIfPrimaryTerm())
|
||||||
.retryOnConflict(query.getRetryOnConflict()) //
|
.retryOnConflict(query.getRetryOnConflict());
|
||||||
;
|
|
||||||
|
|
||||||
// no refresh, timeout, waitForActiveShards on UpdateOperation or UpdateAction
|
// no refresh, timeout, waitForActiveShards on UpdateOperation or UpdateAction
|
||||||
|
|
||||||
@ -1095,17 +1094,16 @@ class RequestConverter extends AbstractQueryProcessor {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
uqb //
|
uqb
|
||||||
.doc(query.getDocument()) //
|
.doc(query.getDocument())
|
||||||
.upsert(query.getUpsert()) //
|
.upsert(query.getUpsert())
|
||||||
.routing(query.getRouting() != null ? query.getRouting() : routing) //
|
.routing(query.getRouting() != null ? query.getRouting() : routing)
|
||||||
.scriptedUpsert(query.getScriptedUpsert()) //
|
.scriptedUpsert(query.getScriptedUpsert())
|
||||||
.docAsUpsert(query.getDocAsUpsert()) //
|
.docAsUpsert(query.getDocAsUpsert())
|
||||||
.ifSeqNo(query.getIfSeqNo() != null ? Long.valueOf(query.getIfSeqNo()) : null) //
|
.ifSeqNo(query.getIfSeqNo())
|
||||||
.ifPrimaryTerm(query.getIfPrimaryTerm() != null ? Long.valueOf(query.getIfPrimaryTerm()) : null) //
|
.ifPrimaryTerm(query.getIfPrimaryTerm())
|
||||||
.refresh(query.getRefreshPolicy() != null ? refresh(query.getRefreshPolicy()) : refresh(refreshPolicy)) //
|
.refresh(query.getRefreshPolicy() != null ? refresh(query.getRefreshPolicy()) : refresh(refreshPolicy))
|
||||||
.retryOnConflict(query.getRetryOnConflict()) //
|
.retryOnConflict(query.getRetryOnConflict());
|
||||||
;
|
|
||||||
|
|
||||||
if (query.getFetchSource() != null) {
|
if (query.getFetchSource() != null) {
|
||||||
uqb.source(sc -> sc.fetch(query.getFetchSource()));
|
uqb.source(sc -> sc.fetch(query.getFetchSource()));
|
||||||
@ -1293,7 +1291,7 @@ class RequestConverter extends AbstractQueryProcessor {
|
|||||||
.timeout(timeStringMs(query.getTimeout())) //
|
.timeout(timeStringMs(query.getTimeout())) //
|
||||||
;
|
;
|
||||||
|
|
||||||
bb.from((int) (query.getPageable().isPaged() ? query.getPageable().getOffset() : 0))
|
bb.from((int) (query.getPageable().isPaged() ? query.getPageable().getOffset() : 0))
|
||||||
.size(query.getRequestSize());
|
.size(query.getRequestSize());
|
||||||
|
|
||||||
if (!isEmpty(query.getFields())) {
|
if (!isEmpty(query.getFields())) {
|
||||||
@ -1466,7 +1464,7 @@ class RequestConverter extends AbstractQueryProcessor {
|
|||||||
builder.seqNoPrimaryTerm(true);
|
builder.seqNoPrimaryTerm(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
builder.from((int) (query.getPageable().isPaged() ? query.getPageable().getOffset() : 0))
|
builder.from((int) (query.getPageable().isPaged() ? query.getPageable().getOffset() : 0))
|
||||||
.size(query.getRequestSize());
|
.size(query.getRequestSize());
|
||||||
|
|
||||||
if (!isEmpty(query.getFields())) {
|
if (!isEmpty(query.getFields())) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user