### CI Link

- https://gradle-enterprise.elastic.co/s/tl3jqzmzqyktq (PR branch)
- https://gradle-enterprise.elastic.co/s/6ao6q7f42tsly (main)

### Repro line

./gradlew ':server:test' --tests "org.elasticsearch.index.mapper.vectors.DenseVectorFieldMapperTests.testVectorSimilarity" -Dtests.seed=39343A357A78EC3 -Dtests.locale=zh-CN -Dtests.timezone=Africa/Maseru -Druntime.java=21

### Does it reproduce?

Yes

### Applicable branches

main

### Failure history

_No response_

### Failure excerpt

  2> java.lang.AssertionError: expected:<COSINE> but was:<DOT_PRODUCT>
        at __randomizedtesting.SeedInfo.seed([39343A357A78EC3:75EC84B47EC59CF]:0)
        at org.junit.Assert.fail(Assert.java:88)
        at org.junit.Assert.failNotEquals(Assert.java:834)
        at org.junit.Assert.assertEquals(Assert.java:118)
        at org.junit.Assert.assertEquals(Assert.java:144)
        at org.elasticsearch.index.mapper.vectors.DenseVectorFieldMapperTests.testVectorSimilarity(DenseVectorFieldMapperTests.java:776)
server/src/test/java/org/elasticsearch/index/mapper/vectors/DenseVectorFieldMapperTests.java
XContentBuilder mapping = mapping(b -> {
            b.startObject("field");
            b.field("type", "dense_vector");
            b.endObject();
        });
        MapperService mapperService = createMapperService(mapping);
        mapping = mapping(b -> {
            b.startObject("field");
            b.field("type", "dense_vector").field("dims", 4).field("similarity", "cosine").field("index", true);
            b.endObject();
        });
        merge(mapperService, mapping);
        assertEquals(
            XContentHelper.convertToMap(BytesReference.bytes(mapping), false, mapping.contentType()).v2(),
            XContentHelper.convertToMap(mapperService.documentMapper().mappingSource().uncompressed(), false, mapping.contentType()).v2()
        );
    }
    public void testDefaults() throws Exception {
        DocumentMapper mapper = createDocumentMapper(fieldMapping(b -> b.field("type", "dense_vector").field("dims", 3)));
        testIndexedVector(VectorSimilarity.COSINE, mapper);
    }
    public void testIndexedVector() throws Exception {
        VectorSimilarity similarity = RandomPicks.randomFrom(random(), VectorSimilarity.values());
        DocumentMapper mapper = createDocumentMapper(
            fieldMapping(b -> b.field("type", "dense_vector").field("dims", 3).field("similarity", similarity))
        );
        testIndexedVector(similarity, mapper);
    }
    private void testIndexedVector(VectorSimilarity similarity, DocumentMapper mapper) throws Exception {
        float[] vector = { -0.5f, 0.5f, 0.7071f };