I have a query that returns really long strings sometimes. I want to truncate the string to a max length of let's say 200 characters. I'm calling a webhook that has a parameter like this:
do'h, my bad. I was thinking in terms of Elasticsearch 5 using the new and fresh scripting language. You can do something similar in groovy, along the lines
x.data.collect { x -> x.a.substring(0, Math.min(x.a.length(), 10)) }
not tested this time and top of my more and more rusty groovy skills.
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.