@Override
    public final int encode(ByteBuffer buffer) {
        // TODO: Remove once backend support deserialisation of this type.
        if (getClass() == MultiRangeItem.class) return asCompositeItem().encode(buffer);

        super.encodeThis(buffer);
        byte metadata = 0;
        metadata |= (byte)((byte)(operatorType().code << 5) & (byte)0b11100000);
        metadata |= (byte)(termType().code & (byte)0b00011111);
        buffer.put(metadata);
        buffer.putInt(terms());
        encodeBlueprint(buffer);
        encodeTerms(buffer);
        return 1;
    }
Encode all wrapped terms to the buffer.
container-search/src/main/java/com/yahoo/prelude/query/MultiTermItem.java