server/src/main/java/org/elasticsearch/index/mapper/vectors/DenseVectorFieldMapper.java
public DocValuesLoader docValuesLoader(LeafReader leafReader, int[] docIdsInLeaf) throws IOException {
            values = leafReader.getBinaryDocValues(name());
            if (values == null) {
                return null;
            }
            return docId -> {
                hasValue = docId == values.advance(docId);
                return hasValue;
            };
        }
        @Override
        public boolean hasValue() {
            return hasValue;
        }
        @Override
        public void write(XContentBuilder b) throws IOException {
            if (false == hasValue) {
                return;
            }
            b.startArray(simpleName());
            BytesRef ref = values.binaryValue();
            ByteBuffer byteBuffer = ByteBuffer.wrap(ref.bytes, ref.offset, ref.length);
            for (int dim = 0; dim < dims; dim++) {
                elementType.readAndWriteValue(byteBuffer, b);
            }
            b.endArray();
        }
    }
}