mirror of
https://github.com/spring-projects/spring-data-elasticsearch.git
synced 2025-05-30 16:52:11 +00:00
Polishing
This commit is contained in:
parent
3f2ab4b06a
commit
dd3d01eab6
@ -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
|
||||
*/
|
||||
|
@ -60,6 +60,6 @@ public enum FieldType {
|
||||
Rank_Features, //
|
||||
/** since 4.2 */
|
||||
Wildcard, //
|
||||
/** @since 4.2 */
|
||||
Dense_Vector //
|
||||
/** @since 4.2 */
|
||||
Dense_Vector //
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user