@Override public void readFrom(StreamInput in) throws IOException { super.readFrom(in); percolatorTypeId = in.readByte(); requestedSize = in.readVInt(); count = in.readVLong(); matches = new BytesRef[in.readVInt()]; for (int i = 0; i < matches.length; i++) { matches[i] = in.readBytesRef(); } scores = new float[in.readVInt()]; for (int i = 0; i < scores.length; i++) { scores[i] = in.readFloat(); } int size = in.readVInt(); for (int i = 0; i < size; i++) { int mSize = in.readVInt(); Map<String, HighlightField> fields = new HashMap<>(); for (int j = 0; j < mSize; j++) { fields.put(in.readString(), HighlightField.readHighlightField(in)); } hls.add(fields); } aggregations = InternalAggregations.readOptionalAggregations(in); if (in.readBoolean()) { int pipelineAggregatorsSize = in.readVInt(); List<SiblingPipelineAggregator> pipelineAggregators = new ArrayList<>(pipelineAggregatorsSize); for (int i = 0; i < pipelineAggregatorsSize; i++) { BytesReference type = in.readBytesReference(); PipelineAggregator pipelineAggregator = PipelineAggregatorStreams.stream(type).readResult(in); pipelineAggregators.add((SiblingPipelineAggregator) pipelineAggregator); } this.pipelineAggregators = pipelineAggregators; } }
public static void registerStreams() { PipelineAggregatorStreams.registerStream(STREAM, TYPE.stream()); }