File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
server/src/main/java/org/elasticsearch/action/admin/indices/mapping/get Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 36
36
37
37
import java .io .IOException ;
38
38
import java .io .InputStream ;
39
+ import java .util .Collections ;
39
40
import java .util .HashMap ;
40
41
import java .util .Map ;
41
42
import java .util .Objects ;
@@ -66,7 +67,11 @@ public class GetFieldMappingsResponse extends ActionResponse implements ToXConte
66
67
String index = in .readString ();
67
68
if (in .getVersion ().before (Version .V_8_0_0 )) {
68
69
int typesSize = in .readVInt ();
69
- assert typesSize == 1 ;
70
+ assert typesSize == 1 || typesSize == 0 : "Expected 0 or 1 types but got " + typesSize ;
71
+ if (typesSize == 0 ) {
72
+ indexMapBuilder .put (index , Collections .emptyMap ());
73
+ continue ;
74
+ }
70
75
in .readString (); // type
71
76
}
72
77
int fieldSize = in .readVInt ();
You can’t perform that action at this time.
0 commit comments