server/src/test/java/org/elasticsearch/index/mapper/vectors/DenseVectorFieldMapperTests.java
Object value = elementType == ElementType.BYTE
                ? randomList(dims, dims, ESTestCase::randomByte)
                : randomList(dims, dims, ESTestCase::randomFloat);
            return new SyntheticSourceExample(value, value, this::mapping);
        }
        private void mapping(XContentBuilder b) throws IOException {
            b.field("type", "dense_vector");
            b.field("dims", dims);
            if (elementType == ElementType.BYTE || randomBoolean()) {
                b.field("element_type", elementType.toString());
            }
            if (indexed) {
                b.field("index", true);
                b.field("similarity", "l2_norm");
                if (indexOptionsSet) {
                    b.startObject("index_options");
                    b.field("type", "hnsw");
                    b.field("m", 5);
                    b.field("ef_construction", 50);
                    b.endObject();
                }
            }
        }
        @Override
        public List<SyntheticSourceInvalidExample> invalidExample() {
            return List.of();
        }
    }
}