diff options
author | Simon Willnauer <simon.willnauer@elasticsearch.com> | 2016-09-14 15:25:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-14 15:25:25 +0200 |
commit | d402ca0dd721590bb516776aca67a8804c5649be (patch) | |
tree | e4af3d249e6ac2710cb232c0190826f4f08ea70b /core/src/main/java/org/elasticsearch/search/suggest/completion | |
parent | c1e84618a674d7a54e52725c6d927343085bb01d (diff) |
Remove poor-mans compression in InternalSearchHit and friends (#20472)
We still use some crazy poor mans compression in InternalSearchHit that
uses a thread local and an unordered map as a lookup table if requested.
Stuff like this should be handled by compression on the transport layer
rather than in-line in the serialization code. This code is complex enough.
Diffstat (limited to 'core/src/main/java/org/elasticsearch/search/suggest/completion')
-rw-r--r-- | core/src/main/java/org/elasticsearch/search/suggest/completion/CompletionSuggestion.java | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/core/src/main/java/org/elasticsearch/search/suggest/completion/CompletionSuggestion.java b/core/src/main/java/org/elasticsearch/search/suggest/completion/CompletionSuggestion.java index 8453371078..c86c056522 100644 --- a/core/src/main/java/org/elasticsearch/search/suggest/completion/CompletionSuggestion.java +++ b/core/src/main/java/org/elasticsearch/search/suggest/completion/CompletionSuggestion.java @@ -27,7 +27,6 @@ import org.elasticsearch.common.text.Text; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.search.internal.InternalSearchHit; import org.elasticsearch.search.internal.InternalSearchHits; -import org.elasticsearch.search.internal.InternalSearchHits.StreamContext.ShardTargetType; import org.elasticsearch.search.suggest.Suggest; import java.io.IOException; @@ -261,8 +260,7 @@ public final class CompletionSuggestion extends Suggest.Suggestion<CompletionSug super.readFrom(in); this.doc = Lucene.readScoreDoc(in); if (in.readBoolean()) { - this.hit = InternalSearchHit.readSearchHit(in, - InternalSearchHits.streamContext().streamShardTarget(ShardTargetType.STREAM)); + this.hit = InternalSearchHit.readSearchHit(in); } int contextSize = in.readInt(); this.contexts = new LinkedHashMap<>(contextSize); @@ -283,7 +281,7 @@ public final class CompletionSuggestion extends Suggest.Suggestion<CompletionSug Lucene.writeScoreDoc(out, doc); if (hit != null) { out.writeBoolean(true); - hit.writeTo(out, InternalSearchHits.streamContext().streamShardTarget(ShardTargetType.STREAM)); + hit.writeTo(out); } else { out.writeBoolean(false); } |