summaryrefslogtreecommitdiffstats
path: root/container-search
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2021-02-03 16:19:52 +0100
committerGitHub <noreply@github.com>2021-02-03 16:19:52 +0100
commitdee089ee59db9a013f2382d27630bc29292878c2 (patch)
tree90032eb62c17182b0c766f731290dc1462e02389 /container-search
parentaf3b794fb3a9abd7299ed41122ce1626d79853f6 (diff)
parentaa4eb187c0752fffdb94d6fc127b6e2043521591 (diff)
Merge pull request #16377 from vespa-engine/bratseth/caching-warning
Warn not to cache hits
Diffstat (limited to 'container-search')
-rw-r--r--container-search/src/main/java/com/yahoo/search/result/Hit.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/result/Hit.java b/container-search/src/main/java/com/yahoo/search/result/Hit.java
index c4e287bddb1..d224ec2c7ab 100644
--- a/container-search/src/main/java/com/yahoo/search/result/Hit.java
+++ b/container-search/src/main/java/com/yahoo/search/result/Hit.java
@@ -35,6 +35,8 @@ import java.util.function.BiConsumer;
* done of a lightweight version of the hits, which is cheaper if a significant
* number of hits are filtered out.</p>
*
+ * <p>Do not cache this as it holds references to objects that should be garbage collected.</p>
+ *
* @author bratseth
*/
public class Hit extends ListenableFreezableClass implements Data, Comparable<Hit>, Cloneable {
@@ -45,8 +47,8 @@ public class Hit extends ListenableFreezableClass implements Data, Comparable<Hi
private static final String DOCUMENT_ID = "documentid";
/** A collection of string keyed object properties. */
- private Map<String,Object> fields = null;
- private Map<String,Object> unmodifiableFieldMap = null;
+ private Map<String, Object> fields = null;
+ private Map<String, Object> unmodifiableFieldMap = null;
/** Meta data describing how a given searcher should treat this hit. */
// TODO: The case for this is to allow multiple levels of federation searcher routing.