You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Spring Data Elasticsearch Project, ElasticsearchTemplate#doExists(String, IndexCoordinates) use GetRequest, maybe can use ExistsRequest to replace it。
current code:
@OverrideprotectedbooleandoExists(Stringid, IndexCoordinatesindex) {
Assert.notNull(id, "id must not be null");
Assert.notNull(index, "index must not be null");
GetRequestrequest = requestConverter.documentGetRequest(id, routingResolver.getRouting(), index, true);
returnexecute(client -> client.get(request, EntityAsMap.class)).found();
}
after:
@OverrideprotectedbooleandoExists(Stringid, IndexCoordinatesindex) {
Assert.notNull(id, "id must not be null");
Assert.notNull(index, "index must not be null");
// the method is not exists, need to addExistsRequestrequest = requestConverter.documentExistsRequest(id, routingResolver.getRouting(), index);
returnexecute(client -> client.exists(request)).value();
}
The text was updated successfully, but these errors were encountered:
Elasticsearch Official Documentation say can use HEAD to check document exists.
In Spring Data Elasticsearch Project,
ElasticsearchTemplate#doExists(String, IndexCoordinates)
use GetRequest, maybe can use ExistsRequest to replace it。current code:
after:
The text was updated successfully, but these errors were encountered: