Fix mistake in TopHits change

This commit is contained in:
Nik Everett 2016-04-01 08:42:45 -04:00
parent d919031469
commit b7afd80b3f
2 changed files with 4 additions and 4 deletions

View File

@ -538,7 +538,7 @@ public class TopHitsAggregatorBuilder extends AggregatorBuilder<TopHitsAggregato
factory.fieldNames = fieldNames;
}
factory.from = in.readVInt();
in.readOptionalWriteable(HighlightBuilder::new);
factory.highlightBuilder = in.readOptionalWriteable(HighlightBuilder::new);
if (in.readBoolean()) {
int size = in.readVInt();
List<ScriptField> scriptFields = new ArrayList<>(size);

View File

@ -249,9 +249,9 @@ public abstract class BaseAggregationTestCase<AB extends AggregatorBuilder<AB>>
try (StreamInput in = new NamedWriteableAwareStreamInput(StreamInput.wrap(output.bytes()), namedWriteableRegistry)) {
AggregatorBuilder deserializedQuery = namedWriteableRegistry.getReader(AggregatorBuilder.class, testAgg.getWriteableName())
.read(in);
assertEquals(deserializedQuery, testAgg);
assertEquals(deserializedQuery.hashCode(), testAgg.hashCode());
assertNotSame(deserializedQuery, testAgg);
assertEquals(testAgg, deserializedQuery);
assertEquals(testAgg.hashCode(), deserializedQuery.hashCode());
assertNotSame(testAgg, deserializedQuery);
}
}
}