I'm using Elasticsearch 1.3 and I need to return the source size in a query (I have _source enabled)
I tried with this query:
{
  "query": {
    "match_all" : {}
  },
  "script_fields": {
    "source_size": {
      "script": "_source.toString().length()"
    }
  }
}
But source_size always returns 53.
Then I realized that _source.toString() returns the string "org.elasticsearch.search.lookup.SourceLookup@30e2f99b"
How can I get the json string so that I can get its size? Or any other script code to get the source size (in bytes or string length, I just need to find very big documents)?