diff --git a/solr/core/src/java/org/apache/solr/response/transform/RawValueTransformerFactory.java b/solr/core/src/java/org/apache/solr/response/transform/RawValueTransformerFactory.java index 81e413ea481..ee969d5bf06 100644 --- a/solr/core/src/java/org/apache/solr/response/transform/RawValueTransformerFactory.java +++ b/solr/core/src/java/org/apache/solr/response/transform/RawValueTransformerFactory.java @@ -21,6 +21,7 @@ import java.util.ArrayList; import java.util.Collection; import org.apache.lucene.index.IndexableField; +import org.apache.lucene.index.StorableField; import org.apache.solr.common.SolrDocument; import org.apache.solr.common.params.CommonParams; import org.apache.solr.common.params.SolrParams; @@ -135,14 +136,14 @@ public class RawValueTransformerFactory extends TransformerFactory @Override public void write(String name, TextResponseWriter writer) throws IOException { -// String str = null; -// if(val instanceof IndexableField) { // delays holding it in memory -// str = ((IndexableField)val).stringValue(); -// } -// else { -// str = val.toString(); -// } - writer.getWriter().write(val.toString()); + String str = null; + if(val instanceof StorableField) { // delays holding it in memory + str = ((StorableField)val).stringValue(); + } + else { + str = val.toString(); + } + writer.getWriter().write(str); } @Override