server/src/main/java/org/elasticsearch/index/mapper/vectors/DenseVectorFieldMapper.java
Query knnQuery = switch (elementType) {
                case BYTE -> {
                    byte[] bytes = new byte[queryVector.length];
                    for (int i = 0; i < queryVector.length; i++) {
                        bytes[i] = (byte) queryVector[i];
                    }
                    yield new KnnByteVectorQuery(name(), bytes, numCands, filter);
                }
                case FLOAT -> new KnnFloatVectorQuery(name(), queryVector, numCands, filter);
            };
            if (similarityThreshold != null) {
                knnQuery = new VectorSimilarityQuery(
                    knnQuery,
                    similarityThreshold,
                    similarity.score(similarityThreshold, elementType, dims)
                );
            }
            return knnQuery;
        }
    }
    private final ElementType elementType;
    private final int dims;
    private final boolean indexed;
    private final VectorSimilarity similarity;
    private final IndexOptions indexOptions;
    private final Version indexCreatedVersion;
    private DenseVectorFieldMapper(
        String simpleName,
        MappedFieldType mappedFieldType,
        ElementType elementType,