mirror of
https://github.com/spring-projects/spring-data-elasticsearch.git
synced 2025-06-14 08:02:11 +00:00
parent
cf135f4cdd
commit
44a79093ce
@ -13,6 +13,15 @@ See <<elasticsearch-migration-guide-4.4-5.0.breaking-changes-packages>>, all cla
|
||||
deprecated, as the default client implementations to use are the ones based on the new Java Client from
|
||||
Elasticsearch, see <<elasticsearch-migration-guide-4.4-5.0.new-clients>>
|
||||
|
||||
=== Removal of deprecated code
|
||||
|
||||
`DateFormat.none` and `DateFormat.custom` had been deprecated since version 4.2 and have been removed.
|
||||
|
||||
The properties of `@Document` that were deprecated since 4.2 have been removed. Use the `@Settings` annotation for
|
||||
these.
|
||||
|
||||
`@DynamicMapping` and `@DynamicMappingValue` have been removed. Use `@Document.dynamic` or `@Field.dynamic` instead.
|
||||
|
||||
[[elasticsearch-migration-guide-4.4-5.0.breaking-changes]]
|
||||
== Breaking Changes
|
||||
|
||||
|
@ -18,7 +18,9 @@ package org.springframework.data.elasticsearch.annotations;
|
||||
/**
|
||||
* Values based on reference doc - https://www.elastic.co/guide/reference/mapping/date-format/. The patterns are taken
|
||||
* from this documentation and slightly adapted so that a Java {@link java.time.format.DateTimeFormatter} produces the
|
||||
* same values as the Elasticsearch formatter.
|
||||
* same values as the Elasticsearch formatter. Use <code>format = {}</code> to disable built-in date * formats in
|
||||
* the @Field annotation. If you want to use only a custom date format pattern, you must set the <code>format</code> *
|
||||
* property to empty <code>{}</code>.
|
||||
*
|
||||
* @author Jakub Vavrik
|
||||
* @author Tim te Beek
|
||||
@ -26,19 +28,6 @@ package org.springframework.data.elasticsearch.annotations;
|
||||
* @author Sascha Woo
|
||||
*/
|
||||
public enum DateFormat {
|
||||
/**
|
||||
* @deprecated since 4.2, will be removed in a future version. Use <code>format = {}</code> to disable built-in date
|
||||
* formats in the @Field annotation.
|
||||
*/
|
||||
@Deprecated
|
||||
none(""), //
|
||||
/**
|
||||
* @deprecated since 4.2, will be removed in a future version.It is no longer required for using a custom date format
|
||||
* pattern. If you want to use only a custom date format pattern, you must set the <code>format</code>
|
||||
* property to empty <code>{}</code>.
|
||||
*/
|
||||
@Deprecated
|
||||
custom(""), //
|
||||
basic_date("uuuuMMdd"), //
|
||||
basic_date_time("uuuuMMdd'T'HHmmss.SSSXXX"), //
|
||||
basic_date_time_no_millis("uuuuMMdd'T'HHmmssXXX"), //
|
||||
|
@ -53,49 +53,6 @@ public @interface Document {
|
||||
*/
|
||||
String indexName();
|
||||
|
||||
/**
|
||||
* Use server-side settings when creating the index.
|
||||
*
|
||||
* @deprecated since 4.2, use the {@link Setting} annotation to configure settings
|
||||
*/
|
||||
@Deprecated
|
||||
boolean useServerConfiguration() default false;
|
||||
|
||||
/**
|
||||
* Number of shards for the index {@link #indexName()}. Used for index creation. <br/>
|
||||
* With version 4.0, the default value is changed from 5 to 1 to reflect the change in the default settings of
|
||||
* Elasticsearch which changed to 1 as well in Elasticsearch 7.0.
|
||||
* ComposableAnnotationsUnitTest.documentAnnotationShouldBeComposable:60
|
||||
*
|
||||
* @deprecated since 4.2, use the {@link Setting} annotation to configure settings
|
||||
*/
|
||||
@Deprecated
|
||||
short shards() default 1;
|
||||
|
||||
/**
|
||||
* Number of replicas for the index {@link #indexName()}. Used for index creation.
|
||||
*
|
||||
* @deprecated since 4.2, use the {@link Setting} annotation to configure settings
|
||||
*/
|
||||
@Deprecated
|
||||
short replicas() default 1;
|
||||
|
||||
/**
|
||||
* Refresh interval for the index {@link #indexName()}. Used for index creation.
|
||||
*
|
||||
* @deprecated since 4.2, use the {@link Setting} annotation to configure settings
|
||||
*/
|
||||
@Deprecated
|
||||
String refreshInterval() default "1s";
|
||||
|
||||
/**
|
||||
* Index storage type for the index {@link #indexName()}. Used for index creation.
|
||||
*
|
||||
* @deprecated since 4.2, use the {@link Setting} annotation to configure settings
|
||||
*/
|
||||
@Deprecated
|
||||
String indexStoreType() default "fs";
|
||||
|
||||
/**
|
||||
* Configuration whether to create an index on repository bootstrapping.
|
||||
*/
|
||||
|
@ -1,40 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2022 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.annotations;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* Annotation to set the dynamic mapping mode
|
||||
* {@see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/dynamic.html">elasticsearch doc</a>}
|
||||
*
|
||||
* @author Peter-Josef Meisch
|
||||
* @author Sascha Woo
|
||||
* @since 4.0
|
||||
* @deprecated since 4.3, use {@link Document#dynamic()} or {@link Field#dynamic()} instead.
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ ElementType.TYPE, ElementType.FIELD })
|
||||
@Documented
|
||||
@Deprecated
|
||||
public @interface DynamicMapping {
|
||||
|
||||
DynamicMappingValue value() default DynamicMappingValue.True;
|
||||
}
|
@ -1,39 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2022 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.annotations;
|
||||
|
||||
/**
|
||||
* values for the {@link DynamicMapping annotation}
|
||||
*
|
||||
* @author Peter-Josef Meisch
|
||||
* @author Sascha Woo
|
||||
* @since 4.0
|
||||
* @deprecated since 4.3, use {@link Document#dynamic()} or {@link Field#dynamic()} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public enum DynamicMappingValue {
|
||||
True("true"), False("false"), Strict("strict");
|
||||
|
||||
private final String mappedName;
|
||||
|
||||
DynamicMappingValue(String mappedName) {
|
||||
this.mappedName = mappedName;
|
||||
}
|
||||
|
||||
public String getMappedName() {
|
||||
return mappedName;
|
||||
}
|
||||
}
|
@ -52,13 +52,6 @@ public @interface Query {
|
||||
@AliasFor("value")
|
||||
String query() default "";
|
||||
|
||||
/**
|
||||
* Named Query Named looked up by repository.
|
||||
*
|
||||
* @deprecated since 4.2, not implemented and used anywhere
|
||||
*/
|
||||
String name() default "";
|
||||
|
||||
/**
|
||||
* Returns whether the query defined should be executed as count projection.
|
||||
*
|
||||
|
@ -171,14 +171,6 @@ public interface ClientConfiguration {
|
||||
*/
|
||||
Function<WebClient, WebClient> getWebClientConfigurer();
|
||||
|
||||
/**
|
||||
* @return the Rest Client configuration callback.
|
||||
* @since 4.2
|
||||
* @deprecated since 4.3 use {@link #getClientConfigurers()}
|
||||
*/
|
||||
@Deprecated
|
||||
HttpClientConfigCallback getHttpClientConfigurer();
|
||||
|
||||
/**
|
||||
* @return the client configuration callbacks
|
||||
* @since 4.3
|
||||
@ -347,29 +339,6 @@ public interface ClientConfiguration {
|
||||
*/
|
||||
TerminalClientConfigurationBuilder withProxy(String proxy);
|
||||
|
||||
/**
|
||||
* set customization hook in case of a reactive configuration
|
||||
*
|
||||
* @param webClientConfigurer function to configure the WebClient
|
||||
* @return the {@link TerminalClientConfigurationBuilder}.
|
||||
* @deprecated since 4.3, use {@link #withClientConfigurer(ClientConfigurationCallback)} with
|
||||
* {@link ReactiveRestClients.WebClientConfigurationCallback}
|
||||
*/
|
||||
@Deprecated
|
||||
TerminalClientConfigurationBuilder withWebClientConfigurer(Function<WebClient, WebClient> webClientConfigurer);
|
||||
|
||||
/**
|
||||
* Register a {HttpClientConfigCallback} to configure the non-reactive REST client.
|
||||
*
|
||||
* @param httpClientConfigurer configuration callback, must not be null.
|
||||
* @return the {@link TerminalClientConfigurationBuilder}.
|
||||
* @since 4.2
|
||||
* @deprecated since 4.3, use {@link #withClientConfigurer(ClientConfigurationCallback)} with
|
||||
* {@link RestClients.RestClientConfigurationCallback}
|
||||
*/
|
||||
@Deprecated
|
||||
TerminalClientConfigurationBuilder withHttpClientConfigurer(HttpClientConfigCallback httpClientConfigurer);
|
||||
|
||||
/**
|
||||
* Register a {@link ClientConfigurationCallback} to configure the client.
|
||||
*
|
||||
|
@ -202,28 +202,6 @@ class ClientConfigurationBuilder
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TerminalClientConfigurationBuilder withWebClientConfigurer(
|
||||
Function<WebClient, WebClient> webClientConfigurer) {
|
||||
|
||||
Assert.notNull(webClientConfigurer, "webClientConfigurer must not be null");
|
||||
|
||||
this.webClientConfigurer = webClientConfigurer;
|
||||
this.clientConfigurers.add(ReactiveRestClients.WebClientConfigurationCallback.from(webClientConfigurer));
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TerminalClientConfigurationBuilder withHttpClientConfigurer(HttpClientConfigCallback httpClientConfigurer) {
|
||||
|
||||
Assert.notNull(httpClientConfigurer, "httpClientConfigurer must not be null");
|
||||
|
||||
this.httpClientConfigurer = httpClientConfigurer;
|
||||
this.clientConfigurers
|
||||
.add(RestClients.RestClientConfigurationCallback.from(httpClientConfigurer::customizeHttpClient));
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TerminalClientConfigurationBuilder withClientConfigurer(
|
||||
ClientConfiguration.ClientConfigurationCallback<?> clientConfigurer) {
|
||||
|
@ -129,12 +129,6 @@ class DefaultClientConfiguration implements ClientConfiguration {
|
||||
return webClientConfigurer;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public HttpClientConfigCallback getHttpClientConfigurer() {
|
||||
return httpClientConfigurer;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public <T> List<ClientConfigurationCallback<?>> getClientConfigurers() {
|
||||
|
@ -81,7 +81,9 @@ import org.springframework.web.reactive.function.client.WebClient;
|
||||
* @since 3.2
|
||||
* @see ClientConfiguration
|
||||
* @see ReactiveRestClients
|
||||
* @deprecated since 5.0
|
||||
*/
|
||||
@Deprecated
|
||||
public interface ReactiveElasticsearchClient {
|
||||
|
||||
/**
|
||||
|
@ -23,8 +23,10 @@ import org.springframework.web.reactive.function.client.WebClientException;
|
||||
* @author Christoph Strobl
|
||||
* @author Mark Paluch
|
||||
* @since 3.2
|
||||
* @deprecated since 5.0
|
||||
*/
|
||||
public class RequestBodyEncodingException extends WebClientException {
|
||||
|
||||
@Deprecated public class RequestBodyEncodingException extends WebClientException {
|
||||
|
||||
private static final long serialVersionUID = 472776714118912855L;
|
||||
|
||||
|
@ -313,12 +313,6 @@ public abstract class AbstractElasticsearchTemplate implements ElasticsearchOper
|
||||
return doDelete(id, routingResolver.getRouting(), index);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
final public String delete(String id, @Nullable String routing, IndexCoordinates index) {
|
||||
return doDelete(id, routing, index);
|
||||
}
|
||||
|
||||
protected abstract String doDelete(String id, @Nullable String routing, IndexCoordinates index);
|
||||
|
||||
@Override
|
||||
|
@ -245,20 +245,6 @@ public interface DocumentOperations {
|
||||
*/
|
||||
String delete(String id, IndexCoordinates index);
|
||||
|
||||
/**
|
||||
* Delete the one object with provided id.
|
||||
*
|
||||
* @param id the document to delete
|
||||
* @param routing the optional routing for the document to be deleted
|
||||
* @param index the index from which to delete
|
||||
* @return documentId of the document deleted
|
||||
* @since 4.1
|
||||
* @deprecated since 4.2, use {@link ElasticsearchOperations#withRouting(RoutingResolver)} and
|
||||
* {@link #delete(String, IndexCoordinates)}
|
||||
*/
|
||||
@Deprecated
|
||||
String delete(String id, @Nullable String routing, IndexCoordinates index);
|
||||
|
||||
/**
|
||||
* Delete the one object with provided id.
|
||||
*
|
||||
|
@ -50,16 +50,6 @@ public class SearchHit<T> {
|
||||
@Nullable private final Explanation explanation;
|
||||
private final List<String> matchedQueries = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* @deprecated since 4.2 use
|
||||
* {@link #SearchHit(String, String, String, float, Object[], Map, Map, NestedMetaData, Explanation, List, Object)}.
|
||||
*/
|
||||
@Deprecated
|
||||
public SearchHit(@Nullable String index, @Nullable String id, @Nullable String routing, float score,
|
||||
@Nullable Object[] sortValues, @Nullable Map<String, List<String>> highlightFields, T content) {
|
||||
this(index, id, routing, score, sortValues, highlightFields, null, null, null, null, content);
|
||||
}
|
||||
|
||||
public SearchHit(@Nullable String index, @Nullable String id, @Nullable String routing, float score,
|
||||
@Nullable Object[] sortValues, @Nullable Map<String, List<String>> highlightFields,
|
||||
@Nullable Map<String, SearchHits<?>> innerHits, @Nullable NestedMetaData nestedMetaData,
|
||||
|
@ -157,7 +157,6 @@ final public class ElasticsearchDateConverter {
|
||||
case weekyear:
|
||||
case weekyear_week:
|
||||
case weekyear_week_day:
|
||||
case custom:
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -157,7 +157,7 @@ public class MappingBuilder {
|
||||
private class InternalBuilder {
|
||||
|
||||
private boolean writeTypeHints = true;
|
||||
private List<String> excludeFromSource = new ArrayList<>();
|
||||
private final List<String> excludeFromSource = new ArrayList<>();
|
||||
private String nestedPropertyPrefix = "";
|
||||
|
||||
protected String buildPropertyMapping(ElasticsearchPersistentEntity<?> entity,
|
||||
@ -172,8 +172,11 @@ public class MappingBuilder {
|
||||
// Dynamic templates
|
||||
addDynamicTemplatesMapping(objectNode, entity);
|
||||
|
||||
mapEntity(objectNode, entity, true, "", false, FieldType.Auto, null,
|
||||
entity.findAnnotation(DynamicMapping.class), runtimeFields);
|
||||
org.springframework.data.elasticsearch.annotations.Document docAnnotation = entity
|
||||
.findAnnotation(org.springframework.data.elasticsearch.annotations.Document.class);
|
||||
var dynamicMapping = docAnnotation != null ? docAnnotation.dynamic() : null;
|
||||
|
||||
mapEntity(objectNode, entity, true, "", false, FieldType.Auto, null, dynamicMapping, runtimeFields);
|
||||
|
||||
if (!excludeFromSource.isEmpty()) {
|
||||
ObjectNode sourceNode = objectNode.putObject(SOURCE);
|
||||
@ -209,8 +212,8 @@ public class MappingBuilder {
|
||||
|
||||
private void mapEntity(ObjectNode objectNode, @Nullable ElasticsearchPersistentEntity<?> entity,
|
||||
boolean isRootObject, String nestedObjectFieldName, boolean nestedOrObjectField, FieldType fieldType,
|
||||
@Nullable Field parentFieldAnnotation, @Nullable DynamicMapping dynamicMapping,
|
||||
@Nullable Document runtimeFields) throws IOException {
|
||||
@Nullable Field parentFieldAnnotation, @Nullable Dynamic dynamicMapping, @Nullable Document runtimeFields)
|
||||
throws IOException {
|
||||
|
||||
if (entity != null && entity.isAnnotationPresent(Mapping.class)) {
|
||||
Mapping mappingAnnotation = entity.getRequiredAnnotation(Mapping.class);
|
||||
@ -258,8 +261,8 @@ public class MappingBuilder {
|
||||
|
||||
if (entity != null && entity.dynamic() != Dynamic.INHERIT) {
|
||||
objectNode.put(TYPE_DYNAMIC, entity.dynamic().getMappedName());
|
||||
} else if (dynamicMapping != null) {
|
||||
objectNode.put(TYPE_DYNAMIC, dynamicMapping.value().getMappedName());
|
||||
} else if (dynamicMapping != null && dynamicMapping != Dynamic.INHERIT) {
|
||||
objectNode.put(TYPE_DYNAMIC, dynamicMapping.getMappedName());
|
||||
}
|
||||
|
||||
ObjectNode propertiesNode = objectNode.putObject(FIELD_PROPERTIES);
|
||||
@ -339,7 +342,7 @@ public class MappingBuilder {
|
||||
|
||||
boolean isCompletionProperty = property.isCompletionProperty();
|
||||
boolean isNestedOrObjectProperty = isNestedOrObjectProperty(property);
|
||||
DynamicMapping dynamicMapping = property.findAnnotation(DynamicMapping.class);
|
||||
Dynamic dynamicMapping = fieldAnnotation != null ? fieldAnnotation.dynamic() : null;
|
||||
|
||||
if (!isCompletionProperty && property.isEntity() && hasRelevantAnnotation(property)) {
|
||||
|
||||
@ -475,7 +478,7 @@ public class MappingBuilder {
|
||||
* @throws IOException
|
||||
*/
|
||||
private void addSingleFieldMapping(ObjectNode propertiesNode, ElasticsearchPersistentProperty property,
|
||||
Field annotation, boolean nestedOrObjectField, @Nullable DynamicMapping dynamicMapping) throws IOException {
|
||||
Field annotation, boolean nestedOrObjectField, @Nullable Dynamic dynamicMapping) throws IOException {
|
||||
|
||||
// build the property json, if empty skip it as this is no valid mapping
|
||||
ObjectNode fieldNode = objectMapper.createObjectNode();
|
||||
@ -490,8 +493,8 @@ public class MappingBuilder {
|
||||
if (nestedOrObjectField) {
|
||||
if (annotation.dynamic() != Dynamic.INHERIT) {
|
||||
fieldNode.put(TYPE_DYNAMIC, annotation.dynamic().getMappedName());
|
||||
} else if (dynamicMapping != null) {
|
||||
fieldNode.put(TYPE_DYNAMIC, dynamicMapping.value().getMappedName());
|
||||
} else if (dynamicMapping != null && dynamicMapping != Dynamic.INHERIT) {
|
||||
fieldNode.put(TYPE_DYNAMIC, dynamicMapping.getMappedName());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -531,8 +534,7 @@ public class MappingBuilder {
|
||||
* @throws IOException
|
||||
*/
|
||||
private void addMultiFieldMapping(ObjectNode propertyNode, ElasticsearchPersistentProperty property,
|
||||
MultiField annotation, boolean nestedOrObjectField, @Nullable DynamicMapping dynamicMapping)
|
||||
throws IOException {
|
||||
MultiField annotation, boolean nestedOrObjectField, @Nullable Dynamic dynamicMapping) throws IOException {
|
||||
|
||||
// main field
|
||||
ObjectNode mainFieldNode = objectMapper.createObjectNode();
|
||||
@ -541,8 +543,8 @@ public class MappingBuilder {
|
||||
if (nestedOrObjectField) {
|
||||
if (annotation.mainField().dynamic() != Dynamic.INHERIT) {
|
||||
mainFieldNode.put(TYPE_DYNAMIC, annotation.mainField().dynamic().getMappedName());
|
||||
} else if (dynamicMapping != null) {
|
||||
mainFieldNode.put(TYPE_DYNAMIC, dynamicMapping.value().getMappedName());
|
||||
} else if (dynamicMapping != null && dynamicMapping != Dynamic.INHERIT) {
|
||||
mainFieldNode.put(TYPE_DYNAMIC, dynamicMapping.getMappedName());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -244,9 +244,6 @@ public final class MappingParameters {
|
||||
|
||||
// built-in formats
|
||||
for (DateFormat dateFormat : dateFormats) {
|
||||
if (dateFormat == DateFormat.none || dateFormat == DateFormat.custom) {
|
||||
continue;
|
||||
}
|
||||
formats.add(dateFormat.toString());
|
||||
}
|
||||
|
||||
|
@ -395,16 +395,14 @@ public class SimpleElasticsearchPersistentEntity<T> extends BasicPersistentEntit
|
||||
private SettingsParameter buildSettingsParameter(Class<?> clazz) {
|
||||
|
||||
SettingsParameter settingsParameter = new SettingsParameter();
|
||||
Document documentAnnotation = AnnotatedElementUtils.findMergedAnnotation(clazz, Document.class);
|
||||
Setting settingAnnotation = AnnotatedElementUtils.findMergedAnnotation(clazz, Setting.class);
|
||||
|
||||
if (documentAnnotation != null) {
|
||||
settingsParameter.useServerConfiguration = documentAnnotation.useServerConfiguration();
|
||||
settingsParameter.shards = documentAnnotation.shards();
|
||||
settingsParameter.replicas = documentAnnotation.replicas();
|
||||
settingsParameter.refreshIntervall = documentAnnotation.refreshInterval();
|
||||
settingsParameter.indexStoreType = documentAnnotation.indexStoreType();
|
||||
}
|
||||
// default values
|
||||
settingsParameter.useServerConfiguration = false;
|
||||
settingsParameter.shards = 1;
|
||||
settingsParameter.replicas = 1;
|
||||
settingsParameter.refreshIntervall = "1s";
|
||||
settingsParameter.indexStoreType = "fs";
|
||||
|
||||
if (settingAnnotation != null) {
|
||||
processSettingAnnotation(settingAnnotation, settingsParameter);
|
||||
|
@ -261,9 +261,6 @@ public class SimpleElasticsearchPersistentProperty extends
|
||||
// register converters for built-in formats
|
||||
for (DateFormat dateFormat : dateFormats) {
|
||||
switch (dateFormat) {
|
||||
case none:
|
||||
case custom:
|
||||
break;
|
||||
case weekyear:
|
||||
case weekyear_week:
|
||||
case weekyear_week_day:
|
||||
|
@ -221,7 +221,7 @@ public class SimpleElasticsearchRepository<T, ID> implements ElasticsearchReposi
|
||||
|
||||
Assert.notNull(id, "Cannot delete entity with id 'null'.");
|
||||
|
||||
doDelete(id, null, getIndexCoordinates());
|
||||
doDelete(id, getIndexCoordinates());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -229,7 +229,7 @@ public class SimpleElasticsearchRepository<T, ID> implements ElasticsearchReposi
|
||||
|
||||
Assert.notNull(entity, "Cannot delete 'null' entity.");
|
||||
|
||||
doDelete(extractIdFromBean(entity), operations.getEntityRouting(entity), getIndexCoordinates());
|
||||
doDelete(extractIdFromBean(entity), getIndexCoordinates());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -269,10 +269,10 @@ public class SimpleElasticsearchRepository<T, ID> implements ElasticsearchReposi
|
||||
deleteAllById(ids);
|
||||
}
|
||||
|
||||
private void doDelete(@Nullable ID id, @Nullable String routing, IndexCoordinates indexCoordinates) {
|
||||
private void doDelete(@Nullable ID id,IndexCoordinates indexCoordinates) {
|
||||
|
||||
if (id != null) {
|
||||
executeAndRefresh(operations -> operations.delete(stringIdRepresentation(id), routing, indexCoordinates));
|
||||
executeAndRefresh(operations -> operations.delete(stringIdRepresentation(id), indexCoordinates));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -168,10 +168,10 @@ public class ClientConfigurationUnitTests {
|
||||
|
||||
ClientConfiguration clientConfiguration = ClientConfiguration.builder() //
|
||||
.connectedTo("foo", "bar") //
|
||||
.withHttpClientConfigurer(httpClientBuilder -> {
|
||||
.withClientConfigurer(RestClients.RestClientConfigurationCallback.from(httpClientBuilder -> {
|
||||
callCounter.incrementAndGet();
|
||||
return httpClientBuilder;
|
||||
}) //
|
||||
})) //
|
||||
.build();
|
||||
|
||||
ClientConfiguration.ClientConfigurationCallback<?> clientConfigurer = clientConfiguration.getClientConfigurers()
|
||||
@ -189,10 +189,10 @@ public class ClientConfigurationUnitTests {
|
||||
|
||||
ClientConfiguration clientConfiguration = ClientConfiguration.builder() //
|
||||
.connectedTo("foo", "bar") //
|
||||
.withWebClientConfigurer(webClientConfigurer -> {
|
||||
.withClientConfigurer(ReactiveRestClients.WebClientConfigurationCallback.from(webClient -> {
|
||||
callCounter.incrementAndGet();
|
||||
return webClientConfigurer;
|
||||
}) //
|
||||
return webClient;
|
||||
})) //
|
||||
.build();
|
||||
|
||||
ClientConfiguration.ClientConfigurationCallback<?> clientConfigurer = clientConfiguration.getClientConfigurers()
|
||||
|
@ -34,8 +34,6 @@ class ElasticsearchDateConverterUnitTests {
|
||||
void shouldCreateConvertersForAllKnownFormats(DateFormat dateFormat) {
|
||||
|
||||
switch (dateFormat) {
|
||||
case none:
|
||||
case custom:
|
||||
case weekyear:
|
||||
case weekyear_week:
|
||||
case weekyear_week_day:
|
||||
|
@ -1730,8 +1730,7 @@ public class MappingElasticsearchConverterUnitTests {
|
||||
@Nullable
|
||||
@Id private String id;
|
||||
@Nullable
|
||||
@Field(name = "dates", type = FieldType.Date, format = DateFormat.custom,
|
||||
pattern = "dd.MM.uuuu") private List<LocalDate> dates;
|
||||
@Field(name = "dates", type = FieldType.Date, format = {}, pattern = "dd.MM.uuuu") private List<LocalDate> dates;
|
||||
|
||||
@Nullable
|
||||
public String getId() {
|
||||
|
@ -711,19 +711,15 @@ public abstract class MappingBuilderIntegrationTests extends MappingContextBaseT
|
||||
}
|
||||
}
|
||||
|
||||
@Document(indexName = "#{@indexNameProvider.indexName()}")
|
||||
@DynamicMapping(DynamicMappingValue.False)
|
||||
@Document(indexName = "#{@indexNameProvider.indexName()}", dynamic = Dynamic.FALSE)
|
||||
static class DynamicMappingAnnotationEntity {
|
||||
|
||||
@Nullable
|
||||
@DynamicMapping(DynamicMappingValue.Strict)
|
||||
@Field(type = FieldType.Object) private Author author;
|
||||
@Field(type = FieldType.Object, dynamic = Dynamic.STRICT) private Author author;
|
||||
@Nullable
|
||||
@DynamicMapping(DynamicMappingValue.False)
|
||||
@Field(type = FieldType.Object) private Map<String, Object> objectMap;
|
||||
@Field(type = FieldType.Object, dynamic = Dynamic.FALSE) private Map<String, Object> objectMap;
|
||||
@Nullable
|
||||
@DynamicMapping(DynamicMappingValue.False)
|
||||
@Field(type = FieldType.Nested) private List<Map<String, Object>> nestedObjectMap;
|
||||
@Field(type = FieldType.Nested, dynamic = Dynamic.FALSE) private List<Map<String, Object>> nestedObjectMap;
|
||||
|
||||
@Nullable
|
||||
public Author getAuthor() {
|
||||
|
@ -1655,19 +1655,15 @@ public class MappingBuilderUnitTests extends MappingContextBaseTests {
|
||||
@Field(type = Wildcard, nullValue = "WILD", ignoreAbove = 42) private String wildcardWithParams;
|
||||
}
|
||||
|
||||
@Document(indexName = "test-index-configure-dynamic-mapping")
|
||||
@DynamicMapping(DynamicMappingValue.False)
|
||||
@Document(indexName = "test-index-configure-dynamic-mapping", dynamic = Dynamic.FALSE)
|
||||
static class DynamicMappingAnnotationEntity {
|
||||
|
||||
@Nullable
|
||||
@DynamicMapping(DynamicMappingValue.Strict)
|
||||
@Field(type = FieldType.Object) private Author author;
|
||||
@Field(type = FieldType.Object, dynamic = Dynamic.STRICT) private Author author;
|
||||
@Nullable
|
||||
@DynamicMapping(DynamicMappingValue.False)
|
||||
@Field(type = FieldType.Object) private Map<String, Object> objectMap;
|
||||
@Field(type = FieldType.Object, dynamic = Dynamic.FALSE) private Map<String, Object> objectMap;
|
||||
@Nullable
|
||||
@DynamicMapping(DynamicMappingValue.False)
|
||||
@Field(type = FieldType.Nested) private List<Map<String, Object>> nestedObjectMap;
|
||||
@Field(type = FieldType.Nested, dynamic = Dynamic.FALSE) private List<Map<String, Object>> nestedObjectMap;
|
||||
|
||||
@Nullable
|
||||
public Author getAuthor() {
|
||||
|
@ -315,7 +315,7 @@ public class SimpleElasticsearchPersistentPropertyUnitTests {
|
||||
}
|
||||
|
||||
static class DateFieldWithCustomFormatAndNoPattern {
|
||||
@Nullable private @Field(type = FieldType.Date, format = DateFormat.custom, pattern = "") LocalDateTime datetime;
|
||||
@Nullable private @Field(type = FieldType.Date, format = {}, pattern = "") LocalDateTime datetime;
|
||||
|
||||
@Nullable
|
||||
public LocalDateTime getDatetime() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user