summaryrefslogtreecommitdiff
path: root/core/src/main/java/org/elasticsearch/search/suggest/completion
diff options
context:
space:
mode:
authorSimon Willnauer <simon.willnauer@elasticsearch.com>2016-09-14 15:25:25 +0200
committerGitHub <noreply@github.com>2016-09-14 15:25:25 +0200
commitd402ca0dd721590bb516776aca67a8804c5649be (patch)
treee4af3d249e6ac2710cb232c0190826f4f08ea70b /core/src/main/java/org/elasticsearch/search/suggest/completion
parentc1e84618a674d7a54e52725c6d927343085bb01d (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.java6
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);
}