code: @Override
    public void readFrom(StreamInput in) throws IOException {
      super.readFrom(in);
  
      routing = in.readOptionalString();
      preference = in.readOptionalString();
  
      if (in.readBoolean()) {
        querySource = in.readBytesReference();
      } else {
        querySource = null;
      }
  
      if (in.readBoolean()) {
        types = in.readStringArray();
      }
  
      field = in.readString();
      nowInMillis = in.readVLong();
  
      if (in.readBoolean()) {
        ordering = Ordering.values()[in.readVInt()];
      }
  
      if (in.readBoolean()) {
        maxTermsPerShard = in.readVInt();
      }
  
      if (in.readBoolean()) {
        termsEncoding = TermsEncoding.values()[in.readVInt()];
      }
  
      if (in.readBoolean()) {
        expectedTerms = in.readVLong();
      }
    }
docs: Deserialize
  
  @param in the input
  @throws IOException