### 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
DocumentMapper documentMapper = createDocumentMapper(INDEXED_BY_DEFAULT_PREVIOUS_INDEX_VERSION, fieldMapping(b -> {
            b.field("type", "dense_vector").field("dims", 3).field("index", true).field("similarity", "dot_product");
        }));
        DenseVectorFieldMapper denseVectorFieldMapper = (DenseVectorFieldMapper) documentMapper.mappers().getMapper("field");
        DenseVectorFieldType denseVectorFieldType = denseVectorFieldMapper.fieldType();
        assertTrue(denseVectorFieldType.isIndexed());
        assertEquals(VectorSimilarity.DOT_PRODUCT, denseVectorFieldType.getSimilarity());
    }
    public void testDefaultParamsIndexByDefault() throws Exception {
        DocumentMapper documentMapper = createDocumentMapper(fieldMapping(b -> { b.field("type", "dense_vector").field("dims", 3); }));
        DenseVectorFieldMapper denseVectorFieldMapper = (DenseVectorFieldMapper) documentMapper.mappers().getMapper("field");
        DenseVectorFieldType denseVectorFieldType = denseVectorFieldMapper.fieldType();
        assertTrue(denseVectorFieldType.isIndexed());
        assertEquals(VectorSimilarity.COSINE, denseVectorFieldType.getSimilarity());
    }
    public void testAddDocumentsToIndexBefore_V_7_5_0() throws Exception {
        IndexVersion indexVersion = IndexVersions.V_7_4_0;
        DocumentMapper mapper = createDocumentMapper(
            indexVersion,
            fieldMapping(b -> b.field("index", false).field("type", "dense_vector").field("dims", 3))
        );
        float[] validVector = { -12.1f, 100.7f, -4 };
        ParsedDocument doc1 = mapper.parse(source(b -> b.array("field", validVector)));
        List<IndexableField> fields = doc1.rootDoc().getFields("field");
        assertEquals(1, fields.size());
        assertThat(fields.get(0), instanceOf(BinaryDocValuesField.class));
        
        BytesRef vectorBR = fields.get(0).binaryValue();
        float[] decodedValues = decodeDenseVector(indexVersion, vectorBR);
        assertArrayEquals("Decoded dense vector values is not equal to the indexed one.", validVector, decodedValues, 0.001f);