@@ -1126,38 +1126,49 @@ void shouldAddFieldsThatAreExcludedFromSource() throws JSONException {
1126
1126
1127
1127
String expected = """
1128
1128
{
1129
- "properties": {
1130
- "_class": {
1131
- "type": "keyword",
1132
- "index": false,
1133
- "doc_values": false
1134
- },
1135
- "excluded-date": {
1136
- "type": "date",
1137
- "format": "date"
1138
- },
1139
- "nestedEntity": {
1140
- "type": "nested",
1141
- "properties": {
1142
- "_class": {
1143
- "type": "keyword",
1144
- "index": false,
1145
- "doc_values": false
1146
- },
1147
- "excluded-text": {
1148
- "type": "text"
1149
- }
1150
- }
1151
- }
1152
- },
1153
- "_source": {
1154
- "excludes": [
1155
- "excluded-date",
1156
- "nestedEntity.excluded-text"
1157
- ]
1158
- }
1159
- }
1160
- """ ; //
1129
+ "properties": {
1130
+ "_class": {
1131
+ "type": "keyword",
1132
+ "index": false,
1133
+ "doc_values": false
1134
+ },
1135
+ "excluded-date": {
1136
+ "type": "date",
1137
+ "format": "date"
1138
+ },
1139
+ "nestedEntity": {
1140
+ "type": "nested",
1141
+ "properties": {
1142
+ "_class": {
1143
+ "type": "keyword",
1144
+ "index": false,
1145
+ "doc_values": false
1146
+ },
1147
+ "excluded-text": {
1148
+ "type": "text"
1149
+ }
1150
+ }
1151
+ },
1152
+ "excluded-multifield": {
1153
+ "type": "text",
1154
+ "fields": {
1155
+ "keyword": {
1156
+ "type": "keyword"
1157
+ }
1158
+ }
1159
+ }
1160
+ },
1161
+ "_source": {
1162
+ "excludes": [
1163
+ "excluded-date",
1164
+ "nestedEntity.excluded-text",
1165
+ "excluded-multifield"
1166
+ ]
1167
+ }
1168
+
1169
+ }
1170
+
1171
+ """ ; //
1161
1172
1162
1173
String mapping = getMappingBuilder ().buildPropertyMapping (ExcludedFieldEntity .class );
1163
1174
@@ -1243,7 +1254,7 @@ void shouldWriteFieldAliasesToTheMapping() throws JSONException {
1243
1254
1244
1255
assertEquals (expected , mapping , true );
1245
1256
}
1246
-
1257
+
1247
1258
@ Test // #2942
1248
1259
@ DisplayName ("should use custom mapped name" )
1249
1260
void shouldUseCustomMappedName () throws JSONException {
@@ -2192,8 +2203,7 @@ static class DenseVectorEntityWithKnnSearch {
2192
2203
@ Nullable
2193
2204
@ Field (type = FieldType .Dense_Vector , dims = 16 , elementType = FieldElementType .FLOAT ,
2194
2205
knnIndexOptions = @ KnnIndexOptions (type = KnnAlgorithmType .HNSW , m = 16 , efConstruction = 100 ),
2195
- knnSimilarity = KnnSimilarity .DOT_PRODUCT )
2196
- private float [] my_vector ;
2206
+ knnSimilarity = KnnSimilarity .DOT_PRODUCT ) private float [] my_vector ;
2197
2207
2198
2208
@ Nullable
2199
2209
public String getId () {
@@ -2269,8 +2279,7 @@ public void setText(@Nullable String text) {
2269
2279
static class DenseVectorMisMatchConfidenceIntervalClass {
2270
2280
@ Field (type = Dense_Vector , dims = 16 , elementType = FieldElementType .FLOAT ,
2271
2281
knnIndexOptions = @ KnnIndexOptions (type = KnnAlgorithmType .HNSW , m = 16 , confidenceInterval = 0.95F ),
2272
- knnSimilarity = KnnSimilarity .DOT_PRODUCT )
2273
- private float [] dense_vector ;
2282
+ knnSimilarity = KnnSimilarity .DOT_PRODUCT ) private float [] dense_vector ;
2274
2283
}
2275
2284
2276
2285
static class DisabledMappingProperty {
@@ -2553,6 +2562,10 @@ private static class ExcludedFieldEntity {
2553
2562
excludeFromSource = true ) private LocalDate excludedDate ;
2554
2563
@ Nullable
2555
2564
@ Field (type = Nested ) private NestedExcludedFieldEntity nestedEntity ;
2565
+ @ Nullable
2566
+ @ MultiField (mainField = @ Field (name = "excluded-multifield" , type = Text , excludeFromSource = true ), otherFields = {
2567
+ @ InnerField (suffix = "keyword" , type = Keyword )
2568
+ }) private String excludedMultifield ;
2556
2569
}
2557
2570
2558
2571
@ SuppressWarnings ("unused" )
@@ -2599,8 +2612,10 @@ private static class FieldMappedNameEntity {
2599
2612
@ SuppressWarnings ("unused" )
2600
2613
private static class MultiFieldMappedNameEntity {
2601
2614
@ Nullable
2602
- @ MultiField (mainField = @ Field (type = FieldType .Text , mappedTypeName = "match_only_text" ), otherFields = { @ InnerField (suffix = "lower_case" ,
2603
- type = FieldType .Keyword , normalizer = "lower_case_normalizer" , mappedTypeName = "constant_keyword" ) }) private String description ;
2615
+ @ MultiField (mainField = @ Field (type = FieldType .Text , mappedTypeName = "match_only_text" ),
2616
+ otherFields = { @ InnerField (suffix = "lower_case" ,
2617
+ type = FieldType .Keyword , normalizer = "lower_case_normalizer" ,
2618
+ mappedTypeName = "constant_keyword" ) }) private String description ;
2604
2619
}
2605
2620
2606
2621
@ SuppressWarnings ("unused" )
0 commit comments