Polishing

This commit is contained in:
Peter-Josef Meisch 2021-02-26 08:28:45 +01:00
parent 3f2ab4b06a
commit dd3d01eab6
No known key found for this signature in database
GPG Key ID: DE108246970C7708
4 changed files with 13 additions and 15 deletions

View File

@ -159,14 +159,14 @@ public @interface Field {
/**
* if true, the field will be stored in Elasticsearch even if it has a null value
*
*
* @since 4.1
*/
boolean storeNullValue() default false;
/**
* to be used in combination with {@link FieldType#Rank_Feature}
*
*
* @since 4.1
*/
boolean positiveScoreImpact() default true;
@ -189,7 +189,7 @@ public @interface Field {
NullValueType nullValueType() default NullValueType.String;
/**
* to be used in combination with {@link FieldType#Dense_Vector}
* to be used in combination with {@link FieldType#Dense_Vector}
*
* @since 4.2
*/

View File

@ -60,6 +60,6 @@ public enum FieldType {
Rank_Features, //
/** since 4.2 */
Wildcard, //
/** @since 4.2 */
Dense_Vector //
/** @since 4.2 */
Dense_Vector //
}

View File

@ -31,6 +31,7 @@ import lombok.Setter;
import java.lang.Boolean;
import java.lang.Double;
import java.lang.Integer;
import java.lang.Object;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.Collection;
@ -508,7 +509,7 @@ public class MappingBuilderUnitTests extends MappingContextBaseTests {
assertEquals(expected, mapping, false);
}
@Test // #1700
@Test // #1700
@DisplayName("should write dense_vector properties")
void shouldWriteDenseVectorProperties() throws JSONException {
String expected = "{\n" + //
@ -563,9 +564,8 @@ public class MappingBuilderUnitTests extends MappingContextBaseTests {
@DisplayName("should only allow disabled properties on type object")
void shouldOnlyAllowDisabledPropertiesOnTypeObject() {
assertThatThrownBy(() ->
getMappingBuilder().buildPropertyMapping(InvalidDisabledMappingProperty.class)
).isInstanceOf(MappingException.class);
assertThatThrownBy(() -> getMappingBuilder().buildPropertyMapping(InvalidDisabledMappingProperty.class))
.isInstanceOf(MappingException.class);
}
@Setter
@ -982,7 +982,7 @@ public class MappingBuilderUnitTests extends MappingContextBaseTests {
@Field(type = FieldType.Rank_Features) private Map<String, Integer> topics;
}
@Data
@Data
static class DenseVectorEntity {
@Id private String id;
@ -999,15 +999,13 @@ public class MappingBuilderUnitTests extends MappingContextBaseTests {
@Data
static class InvalidDisabledMappingProperty {
@Id private String id;
@Mapping(enabled = false)
@Field(type = Text) private String text;
@Mapping(enabled = false) @Field(type = Text) private String text;
}
@Data
static class DisabledMappingProperty {
@Id private String id;
@Field(type = Text) private String text;
@Mapping(enabled = false)
@Field(type = Object) private Object object;
@Mapping(enabled = false) @Field(type = Object) private Object object;
}
}

View File

@ -1,7 +1,7 @@
package org.springframework.data.elasticsearch.core.index;
import static org.assertj.core.api.Assertions.*;
import static org.springframework.data.elasticsearch.annotations.FieldType.Dense_Vector;
import static org.springframework.data.elasticsearch.annotations.FieldType.*;
import static org.springframework.data.elasticsearch.annotations.FieldType.Object;
import java.lang.annotation.Annotation;