I thought of using a scripted field or just inputting a json script when visualizing data. For example, if I wanted to calculate the average of a field named 'time', but I don't want to take into account the docs with the 'time' field that equals a negative number.
If I had 10 docs, where 2 of them have 'time' = -1, it should only take into account 8 docs in order to calculate the average.
you could filter out those documents using a range query, which is much faster than painless. Why do you specifically ask for painless, I guess I am missing something?
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.