From 1a085d9bfa9e29c43e9a2c3b25393a574ae2fa53 Mon Sep 17 00:00:00 2001 From: Shay Banon Date: Mon, 9 Jul 2012 16:53:20 +0200 Subject: [PATCH] Stored binary fields to change internal representation (break Java API if used), closes #2092. --- src/main/java/org/elasticsearch/index/get/ShardGetService.java | 2 +- src/main/java/org/elasticsearch/search/fetch/FetchPhase.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/elasticsearch/index/get/ShardGetService.java b/src/main/java/org/elasticsearch/index/get/ShardGetService.java index ad3953d89cf..3d40fd8a3af 100644 --- a/src/main/java/org/elasticsearch/index/get/ShardGetService.java +++ b/src/main/java/org/elasticsearch/index/get/ShardGetService.java @@ -167,7 +167,7 @@ public class ShardGetService extends AbstractIndexShardComponent { } if (value == null) { if (field.isBinary()) { - value = field.getBinaryValue(); + value = new BytesArray(field.getBinaryValue(), field.getBinaryOffset(), field.getBinaryLength()); } else { value = field.stringValue(); } diff --git a/src/main/java/org/elasticsearch/search/fetch/FetchPhase.java b/src/main/java/org/elasticsearch/search/fetch/FetchPhase.java index 2cfa36d673d..bae3fff0a37 100644 --- a/src/main/java/org/elasticsearch/search/fetch/FetchPhase.java +++ b/src/main/java/org/elasticsearch/search/fetch/FetchPhase.java @@ -197,7 +197,7 @@ public class FetchPhase implements SearchPhase { } if (value == null) { if (field.isBinary()) { - value = field.getBinaryValue(); + value = new BytesArray(field.getBinaryValue(), field.getBinaryOffset(), field.getBinaryLength()); } else { value = field.stringValue(); }