In our case, the date group only one, most like below, need substring some string fields to aggs,so ,have other idea to excute below search quickly, worry ,please
"groupbydep":{ "terms": { "script": { "lang": "painless", "source":"doc['pdep'].value.substring(0,4)"
I would recommend parsing it out at index time and storing it in a separate field if it is something you want to aggregate efficiently on at scale. That way you do the parsing once per document rather than once per document per query.
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.