class BitStringIndexer implements ValueIndexer<BitString> {

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

    public BitStringIndexer(Reference ref, FieldType fieldType) {
        this.ref = ref;
        this.name = ref.storageIdent();
        this.fieldType = fieldType == null
            ? BitStringFieldMapper.Defaults.FIELD_TYPE
            : fieldType;
    }

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

        BitSet bitSet = value.bitSet();
        byte[] bytes = bitSet.toByteArray();
        xcontentBuilder.value(bytes);

        BytesRef binaryValue = new BytesRef(bytes);
        if (ref.indexType() != IndexType.NONE) {
            addField.accept(new Field(name, binaryValue, fieldType));
        }

        if (ref.hasDocValues()) {
            addField.accept(new SortedSetDocValuesField(name, binaryValue));
        } else {
            addField.accept(new Field(
                FieldNamesFieldMapper.NAME,
                name,
                FieldNamesFieldMapper.Defaults.FIELD_TYPE));
        }
    
<no_super_class>