I'm using ES 6.3, I want to find size of a document using script.
I've tried: "script": "doc.toString().length()"
But doc.toString() is classname org.elasticsearch.search.lookup.LeafDocLookup@57b1c349.
I know I can enable _size by using size-mapper plugin, but don't have access to that, but scripting is enabled, so how can I do this?
Can you explain, what you are trying to achieve? You could try using a script ingest processor and just take the length of the toString() representation of the ctx map, however this would not be accurate, as it is not the original JSON.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.