server/src/main/java/org/elasticsearch/index/mapper/vectors/DenseVectorFieldMapper.java
}
        },
        COSINE(VectorSimilarityFunction.COSINE) {
            @Override
            float score(float similarity, ElementType elementType, int dim) {
                return switch (elementType) {
                    case BYTE, FLOAT -> (1 + similarity) / 2f;
                };
            }
        },
        DOT_PRODUCT(VectorSimilarityFunction.DOT_PRODUCT) {
            @Override
            float score(float similarity, ElementType elementType, int dim) {
                return switch (elementType) {
                    case BYTE -> 0.5f + similarity / (float) (dim * (1 << 15));
                    case FLOAT -> (1 + similarity) / 2f;
                };
            }
        };
        public final VectorSimilarityFunction function;
        VectorSimilarity(VectorSimilarityFunction function) {
            this.function = function;
        }
        @Override
        public final String toString() {
            return name().toLowerCase(Locale.ROOT);
        }
        abstract float score(float similarity, ElementType elementType, int dim);
    }
    private abstract static class IndexOptions implements ToXContent {