Skip to content

Commit 6ad98bf

Browse files
committed
Polishing
1 parent 9149c1b commit 6ad98bf

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

src/main/java/org/springframework/data/elasticsearch/annotations/Field.java

+4
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@
130130
boolean norms() default true;
131131

132132
/**
133+
* NOte that null_value setting are not supported in Elasticsearch for all types. For example setting a null_value on
134+
* a field with type text will throw an exception in the server when the mapping is written to Elasticsearch. Alas,
135+
* the Elasticsearch documentation does not specify on which types it is allowed on which it is not.
136+
*
133137
* @since 4.0
134138
*/
135139
String nullValue() default "";

src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
*/
1616
package org.springframework.data.elasticsearch;
1717

18-
import static co.elastic.clients.elasticsearch._types.query_dsl.QueryBuilders.match;
19-
import static java.util.UUID.randomUUID;
18+
import static co.elastic.clients.elasticsearch._types.query_dsl.QueryBuilders.*;
19+
import static java.util.UUID.*;
2020
import static org.assertj.core.api.Assertions.*;
2121
import static org.springframework.data.elasticsearch.utils.IdGenerator.*;
2222

src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveMappingBuilderUnitTests.java

+7-6
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@
1818
import static org.skyscreamer.jsonassert.JSONAssert.*;
1919
import static org.springframework.data.elasticsearch.annotations.FieldType.*;
2020

21-
import org.springframework.data.elasticsearch.annotations.FieldType;
22-
import org.springframework.data.elasticsearch.annotations.InnerField;
23-
import org.springframework.data.elasticsearch.annotations.MultiField;
2421
import reactor.core.publisher.Mono;
2522
import reactor.core.scheduler.Schedulers;
2623

@@ -34,7 +31,10 @@
3431
import org.springframework.data.elasticsearch.annotations.DateFormat;
3532
import org.springframework.data.elasticsearch.annotations.Document;
3633
import org.springframework.data.elasticsearch.annotations.Field;
34+
import org.springframework.data.elasticsearch.annotations.FieldType;
35+
import org.springframework.data.elasticsearch.annotations.InnerField;
3736
import org.springframework.data.elasticsearch.annotations.Mapping;
37+
import org.springframework.data.elasticsearch.annotations.MultiField;
3838
import org.springframework.data.elasticsearch.core.MappingContextBaseTests;
3939
import org.springframework.lang.Nullable;
4040

@@ -82,7 +82,7 @@ void shouldWriteRuntimeFields() throws JSONException {
8282

8383
assertEquals(expected, mapping, true);
8484
}
85-
85+
8686
@Test // #2952
8787
void shouldMapNullityParameters() throws JSONException {
8888
// Given
@@ -108,9 +108,10 @@ void shouldMapNullityParameters() throws JSONException {
108108
}
109109
}
110110
""";
111-
111+
112112
// When
113-
String result = Mono.defer(() -> mappingBuilder.buildReactivePropertyMapping(MultiFieldWithNullEmptyParameters.class))
113+
String result = Mono
114+
.defer(() -> mappingBuilder.buildReactivePropertyMapping(MultiFieldWithNullEmptyParameters.class))
114115
.subscribeOn(Schedulers.parallel()).block();
115116

116117
// Then

0 commit comments

Comments
 (0)