class FloatVectorIndexer implements ValueIndexer<float[]> {

    final FieldType fieldType;
    private final String name;
    private final Reference ref;

    public FloatVectorIndexer(Reference ref, @Nullable FieldType fieldType) {
        if (fieldType == null) {
            fieldType = new FieldType(FloatVectorFieldMapper.Defaults.FIELD_TYPE);
            fieldType.setVectorAttributes(
                ref.valueType().characterMaximumLength(),
                VectorEncoding.FLOAT32,
                FloatVectorType.SIMILARITY_FUNC
            );
        }
        this.ref = ref;
        this.name = ref.storageIdent();
        this.fieldType = fieldType;
    }

    @Override
    public void indexValue(float @Nullable [] values,
                           XContentBuilder xcontentBuilder,
                           Consumer<? super IndexableField> addField,
                           Map<ColumnIdent, Synthetic> synthetics,
                           Map<ColumnIdent, ColumnConstraint> toValidate) throws IOException {<FILL_FUNCTION_BODY>}

    public static void createFields(String fqn,
                                    FieldType fieldType,
                                    boolean indexed,
                                    boolean hasDocValues,
                                    float @NotNull [] values,
                                    Consumer<? super IndexableField> addField) {
        if (indexed) {
            addField.accept(new KnnFloatVectorField(fqn, values, fieldType));
        }
        if (hasDocValues) {
            int capacity = values.length * Float.BYTES;
            ByteBuffer buffer = ByteBuffer.allocate(capacity).order(ByteOrder.BIG_ENDIAN);
            for (float value : values) {
                buffer.putFloat(value);
            }
            byte[] bytes = new byte[buffer.flip().limit()];
            buffer.get(bytes);
            var field = new BinaryDocValuesField(fqn, new BytesRef(bytes));
            addField.accept(field);
        } else {
            addField.accept(new Field(
                FieldNamesFieldMapper.NAME,
                fqn,
                FieldNamesFieldMapper.Defaults.FIELD_TYPE));
        }
    }
}

        if (values == null) {
            return;
        }
        xcontentBuilder.startArray();
        for (float value : values) {
            xcontentBuilder.value(value);
        }
        xcontentBuilder.endArray();

        createFields(
            name,
            fieldType,
            ref.indexType() != IndexType.NONE,
            ref.hasDocValues(),
            values,
            addField
        );
        if (fieldType.stored()) {
            throw new UnsupportedOperationException("Cannot store float_vector as stored field");
        }
    
<no_super_class>