99
1010import com .carrotsearch .randomizedtesting .annotations .ParametersFactory ;
1111
12- import org .apache .logging .log4j .Level ;
1312import org .apache .lucene .codecs .lucene99 .Lucene99HnswVectorsFormat ;
1413import org .apache .lucene .document .FeatureField ;
1514import org .apache .lucene .index .FieldInfo ;
2827import org .apache .lucene .search .join .ScoreMode ;
2928import org .elasticsearch .action .admin .indices .mapping .put .PutMappingRequest ;
3029import org .elasticsearch .cluster .ClusterChangedEvent ;
31- import org .elasticsearch .cluster .metadata .DataStreamGlobalRetention ;
32- import org .elasticsearch .cluster .metadata .DataStreamLifecycle ;
3330import org .elasticsearch .cluster .metadata .IndexMetadata ;
3431import org .elasticsearch .common .CheckedBiConsumer ;
3532import org .elasticsearch .common .CheckedBiFunction ;
3633import org .elasticsearch .common .Strings ;
3734import org .elasticsearch .common .bytes .BytesReference ;
3835import org .elasticsearch .common .compress .CompressedXContent ;
39- import org .elasticsearch .common .logging .DeprecatedMessage ;
40- import org .elasticsearch .common .logging .DeprecationLogger ;
41- import org .elasticsearch .common .logging .ESLogMessage ;
42- import org .elasticsearch .common .logging .HeaderWarning ;
4336import org .elasticsearch .common .lucene .search .Queries ;
4437import org .elasticsearch .common .settings .Settings ;
45- import org .elasticsearch .common .util .concurrent .ThreadContext ;
4638import org .elasticsearch .core .CheckedConsumer ;
47- import org .elasticsearch .core .TimeValue ;
4839import org .elasticsearch .index .IndexVersion ;
4940import org .elasticsearch .index .IndexVersions ;
5041import org .elasticsearch .index .mapper .DocumentMapper ;
@@ -427,9 +418,7 @@ public void testInvalidTaskTypes() {
427418
428419 @ Override
429420 protected String [] getParseMinimalWarnings () {
430- return new String [] {
431- WARNING_MESSAGE_8X
432- };
421+ return new String [] { WARNING_MESSAGE_8X };
433422 }
434423
435424 public void testOldIndexSemanticTextDenseVectorCreation () throws IOException {
@@ -449,7 +438,8 @@ public void testOldIndexSemanticTextDenseVectorCreation() throws IOException {
449438 fieldMapping ,
450439 true ,
451440 IndexVersions .V_8_0_0 ,
452- IndexVersionUtils .getPreviousVersion (IndexVersions .FIRST_DETACHED_INDEX_VERSION ));
441+ IndexVersionUtils .getPreviousVersion (IndexVersions .FIRST_DETACHED_INDEX_VERSION )
442+ );
453443 assertParseMinimalWarnings ();
454444 assertSemanticTextField (mapperService , fieldName , true , null , null );
455445 }
@@ -463,11 +453,15 @@ public void testOldIndexSemanticTextSparseVersionRaisesError() throws IOExceptio
463453 b .endObject ();
464454 });
465455
466- MapperParsingException exception = assertThrows (MapperParsingException .class , () -> createMapperService (
467- fieldMapping ,
468- true ,
469- IndexVersions .V_8_0_0 ,
470- IndexVersionUtils .getPreviousVersion (IndexVersions .NEW_SPARSE_VECTOR )));
456+ MapperParsingException exception = assertThrows (
457+ MapperParsingException .class ,
458+ () -> createMapperService (
459+ fieldMapping ,
460+ true ,
461+ IndexVersions .V_8_0_0 ,
462+ IndexVersionUtils .getPreviousVersion (IndexVersions .NEW_SPARSE_VECTOR )
463+ )
464+ );
471465 assertTrue (exception .getMessage ().contains (ERROR_MESSAGE_UNSUPPORTED_SPARSE_VECTOR ));
472466 assertTrue (exception .getRootCause () instanceof IllegalArgumentException );
473467 }
0 commit comments