// Document might be compressed (with bytes) or not. In a latter case, convert to string.
Document doc = (Document) obj;
if (/*( timestamp != -1) &&*/ symbolSerializer != null && ((CompressedDocument) doc).getDataBytes() != null) {
result.put(RESULT,
symbolSerializer.convertFromDocument(doc, timestamp));
} else {
result.put(RESULT, TextWriter.toString(doc));
}
} else {
Document doc = (Document) obj;