From 7ff12a5bd96847db625e5d008ea5cd7040cca735 Mon Sep 17 00:00:00 2001 From: Shay Banon Date: Tue, 21 Feb 2012 18:09:55 +0200 Subject: [PATCH] Real time get on a stored _size field does not return its value, closes #1724. --- src/main/java/org/elasticsearch/index/get/ShardGetService.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/org/elasticsearch/index/get/ShardGetService.java b/src/main/java/org/elasticsearch/index/get/ShardGetService.java index 43dfc6a2c57..ecc58f52ad7 100644 --- a/src/main/java/org/elasticsearch/index/get/ShardGetService.java +++ b/src/main/java/org/elasticsearch/index/get/ShardGetService.java @@ -266,6 +266,8 @@ public class ShardGetService extends AbstractIndexShardComponent { if (source.ttl > 0) { value = docMapper.TTLFieldMapper().valueForSearch(source.timestamp + source.ttl); } + } else if (field.equals(SizeFieldMapper.NAME) && docMapper.rootMapper(SizeFieldMapper.class).stored()) { + value = source.source.length(); } else { if (field.contains("_source.")) { if (searchLookup == null) {