code: public static TermsSet readFrom(BytesRef in) {
      TermsByQueryRequest.TermsEncoding termsEncoding = TermsByQueryRequest.TermsEncoding.values()[Bytes.readInt(in)];
      switch (termsEncoding) {
        case INTEGER:
          return new IntegerTermsSet(in);
        case LONG:
          return new LongTermsSet(in);
        case BLOOM:
          return new BloomFilterTermsSet(in);
        case BYTES:
          return new BytesRefTermsSet(in);
        default:
          throw new IllegalArgumentException("[termsByQuery] Invalid terms encoding: " + termsEncoding.name());
      }
    }
docs: Used by {@link solutions.siren.join.index.query.FieldDataTermsQuery} to decode encoded terms.