We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f73ae69 commit e4b36acCopy full SHA for e4b36ac
server/src/main/java/org/elasticsearch/search/SearchHit.java
@@ -726,9 +726,12 @@ private void deallocate() {
726
SearchHit.this.source = null;
727
clearIfMutable(documentFields);
728
clearIfMutable(metaFields);
729
+ this.highlightFields = null;
730
}
731
732
private static void clearIfMutable(Map<String, DocumentField> fields) {
733
+ // check that we're dealing with a HashMap, instances read from the wire that are empty be of an immutable type
734
+ assert fields instanceof HashMap<?, ?> || fields.isEmpty() : fields;
735
if (fields instanceof HashMap<?, ?> hm) {
736
hm.clear();
737
0 commit comments