@Override
 public void readFrom(StreamInput in) throws IOException {
   this.name = in.readString();
   this.order = InternalOrder.Streams.readOrder(in);
   this.valueFormatter = ValueFormatterStreams.readOptional(in);
   this.requiredSize = in.readVInt();
   int size = in.readVInt();
   List<InternalTerms.Bucket> buckets = new ArrayList<InternalTerms.Bucket>(size);
   for (int i = 0; i < size; i++) {
     buckets.add(
         new Bucket(in.readLong(), in.readVLong(), InternalAggregations.readAggregations(in)));
   }
   this.buckets = buckets;
   this.bucketMap = null;
 }