mirror of
https://github.com/spring-projects/spring-data-elasticsearch.git
synced 2025-05-09 18:09:24 +00:00
parent
80a50a83d0
commit
fd975993d3
@ -55,5 +55,7 @@ public enum FieldType {
|
||||
/** @since 4.1 */
|
||||
Rank_Feature, //
|
||||
/** @since 4.1 */
|
||||
Rank_Features //
|
||||
Rank_Features, //
|
||||
/** since 4.2 */
|
||||
Wildcard //
|
||||
}
|
||||
|
@ -257,7 +257,15 @@ public class MappingBuilderIntegrationTests extends MappingContextBaseTests {
|
||||
IndexOperations indexOps = operations.indexOps(TermVectorFieldEntity.class);
|
||||
indexOps.create();
|
||||
indexOps.putMapping();
|
||||
}
|
||||
|
||||
@Test // DATAES-946
|
||||
@DisplayName("should write wildcard field mapping")
|
||||
void shouldWriteWildcardFieldMapping() {
|
||||
|
||||
IndexOperations indexOps = operations.indexOps(WildcardEntity.class);
|
||||
indexOps.create();
|
||||
indexOps.putMapping();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -647,4 +655,11 @@ public class MappingBuilderIntegrationTests extends MappingContextBaseTests {
|
||||
@Field(type = FieldType.Text,
|
||||
termVector = TermVector.with_positions_offsets_payloads) private String with_positions_offsets_payloads;
|
||||
}
|
||||
|
||||
@Data
|
||||
@Document(indexName = "wildcard-test")
|
||||
static class WildcardEntity {
|
||||
@Nullable @Field(type = Wildcard) private String wildcardWithoutParams;
|
||||
@Nullable @Field(type = Wildcard, nullValue = "WILD", ignoreAbove = 42) private String wildcardWithParams;
|
||||
}
|
||||
}
|
||||
|
@ -305,7 +305,7 @@ public class MappingBuilderUnitTests extends MappingContextBaseTests {
|
||||
assertEquals(expected, mapping, false);
|
||||
}
|
||||
|
||||
@Test // DATAES-621, DATAES-943
|
||||
@Test // DATAES-621, DATAES-943, DATAES-946
|
||||
public void shouldSetFieldMappingProperties() throws JSONException {
|
||||
String expected = "{\n" + //
|
||||
" \"properties\": {\n" + //
|
||||
@ -399,6 +399,14 @@ public class MappingBuilderUnitTests extends MappingContextBaseTests {
|
||||
" },\n" + //
|
||||
" \"eagerGlobalOrdinalsFalse\": {\n" + //
|
||||
" \"type\": \"text\"\n" + //
|
||||
" },\n" + //
|
||||
" \"wildcardWithoutParams\": {\n" + //
|
||||
" \"type\": \"wildcard\"\n" + //
|
||||
" },\n" + //
|
||||
" \"wildcardWithParams\": {\n" + //
|
||||
" \"type\": \"wildcard\",\n" + //
|
||||
" \"null_value\": \"WILD\",\n" + //
|
||||
" \"ignore_above\": 42\n" + //
|
||||
" }\n" + //
|
||||
" }\n" + //
|
||||
"}\n"; //
|
||||
@ -891,6 +899,8 @@ public class MappingBuilderUnitTests extends MappingContextBaseTests {
|
||||
@Nullable @Field(type = Object, enabled = false) private String disabledObject;
|
||||
@Nullable @Field(type = Text, eagerGlobalOrdinals = true) private String eagerGlobalOrdinalsTrue;
|
||||
@Nullable @Field(type = Text, eagerGlobalOrdinals = false) private String eagerGlobalOrdinalsFalse;
|
||||
@Nullable @Field(type = Wildcard) private String wildcardWithoutParams;
|
||||
@Nullable @Field(type = Wildcard, nullValue = "WILD", ignoreAbove = 42) private String wildcardWithParams;
|
||||
}
|
||||
|
||||
@Document(indexName = "test-index-configure-dynamic-mapping")
|
||||
@ -945,12 +955,10 @@ public class MappingBuilderUnitTests extends MappingContextBaseTests {
|
||||
|
||||
@Data
|
||||
static class RankFeatureEntity {
|
||||
|
||||
@Id private String id;
|
||||
|
||||
@Field(type = FieldType.Rank_Feature) private Integer pageRank;
|
||||
|
||||
@Field(type = FieldType.Rank_Feature, positiveScoreImpact = false) private Integer urlLength;
|
||||
|
||||
@Field(type = FieldType.Rank_Features) private Map<String, Integer> topics;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user