File tree Expand file tree Collapse file tree 1 file changed +20
-4
lines changed
server/src/test/java/org/elasticsearch/index/mapper Expand file tree Collapse file tree 1 file changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -112,7 +112,23 @@ public void testOffsetArrayNoSyntheticSource() throws Exception {
112112 }
113113
114114 public void testOffsetArrayNoSourceArrayKeep () throws Exception {
115- String mapping = """
115+ var settingsBuilder = Settings .builder ().put ("index.mapping.source.mode" , "synthetic" );
116+ String mapping ;
117+ if (randomBoolean ()) {
118+ mapping = """
119+ {
120+ "_doc": {
121+ "properties": {
122+ "field": {
123+ "type": "keyword",
124+ "synthetic_source_keep": "{{synthetic_source_keep}}"
125+ }
126+ }
127+ }
128+ }
129+ """ .replace ("{{synthetic_source_keep}}" , randomBoolean () ? "none" : "all" );
130+ } else {
131+ mapping = """
116132 {
117133 "_doc": {
118134 "properties": {
@@ -123,9 +139,9 @@ public void testOffsetArrayNoSourceArrayKeep() throws Exception {
123139 }
124140 }
125141 """ ;
126- var settingsBuilder = Settings . builder (). put ( "index.mapping.source.mode" , "synthetic" );
127- if ( randomBoolean ()) {
128- settingsBuilder . put ( "index.mapping.synthetic_source_keep" , randomBoolean () ? "none" : "all" );
142+ if ( randomBoolean ()) {
143+ settingsBuilder . put ( "index.mapping.synthetic_source_keep" , "none" );
144+ }
129145 }
130146 try (var mapperService = createMapperService (settingsBuilder .build (), mapping )) {
131147 var fieldMapper = mapperService .mappingLookup ().getMapper ("field" );
You can’t perform that action at this time.
0 commit comments