File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 2626import org .apache .lucene .tests .index .RandomIndexWriter ;
2727import org .apache .lucene .util .BytesRef ;
2828import org .elasticsearch .common .Strings ;
29+ import org .elasticsearch .common .settings .Settings ;
2930import org .elasticsearch .core .Tuple ;
3031import org .elasticsearch .index .IndexSettings ;
32+ import org .elasticsearch .index .IndexVersions ;
3133import org .elasticsearch .index .mapper .DocumentMapper ;
3234import org .elasticsearch .index .mapper .KeywordFieldMapper ;
3335import org .elasticsearch .index .mapper .LuceneDocument ;
@@ -356,10 +358,14 @@ public void testStoreParameterDefaultsSyntheticSourceTextFieldIsMultiField() thr
356358 }
357359
358360 public void testLoadSyntheticSourceFromStringOrBytesRef () throws IOException {
359- DocumentMapper mapper = createSytheticSourceMapperService ( mapping (b -> {
361+ var mappings = mapping (b -> {
360362 b .startObject ("field1" ).field ("type" , "match_only_text" ).endObject ();
361363 b .startObject ("field2" ).field ("type" , "match_only_text" ).endObject ();
362- })).documentMapper ();
364+ });
365+ var settings = Settings .builder ().put ("index.mapping.source.mode" , "synthetic" ).build ();
366+ DocumentMapper mapper = createMapperService (IndexVersions .UPGRADE_TO_LUCENE_10_2_2 , settings , () -> true , mappings )
367+ .documentMapper ();
368+
363369 try (Directory directory = newDirectory ()) {
364370 RandomIndexWriter iw = indexWriterForSyntheticSource (directory );
365371
You can’t perform that action at this time.
0 commit comments