* Improve SearchHit "equals" implementation for null fields cases
This commit is contained in:
parent
cec02da0ac
commit
d5cec7faa1
|
@ -906,7 +906,7 @@ public final class SearchHit implements Writeable, ToXContentObject, Iterable<Do
|
|||
&& Objects.equals(seqNo, other.seqNo)
|
||||
&& Objects.equals(primaryTerm, other.primaryTerm)
|
||||
&& Objects.equals(source, other.source)
|
||||
&& Objects.equals(fields, other.fields)
|
||||
&& Objects.equals(getFields(), other.getFields())
|
||||
&& Objects.equals(getHighlightFields(), other.getHighlightFields())
|
||||
&& Arrays.equals(matchedQueries, other.matchedQueries)
|
||||
&& Objects.equals(explanation, other.explanation)
|
||||
|
|
|
@ -73,9 +73,12 @@ public class SearchHitTests extends AbstractWireSerializingTestCase<SearchHit> {
|
|||
if (randomBoolean()) {
|
||||
nestedIdentity = NestedIdentityTests.createTestItem(randomIntBetween(0, 2));
|
||||
}
|
||||
Map<String, DocumentField> fields = new HashMap<>();
|
||||
if (randomBoolean()) {
|
||||
fields = GetResultTests.randomDocumentFields(xContentType).v2();
|
||||
Map<String, DocumentField> fields = null;
|
||||
if (frequently()) {
|
||||
fields = new HashMap<>();
|
||||
if (randomBoolean()) {
|
||||
fields = GetResultTests.randomDocumentFields(xContentType).v2();
|
||||
}
|
||||
}
|
||||
SearchHit hit = new SearchHit(internalId, uid, type, nestedIdentity, fields);
|
||||
if (frequently()) {
|
||||
|
|
Loading…
Reference in New Issue