Error:
Fielddata is disabled on text fields by default. Set fielddata=true on [number] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead."
In your mapping the field called number in your source JSON will be stored in 2 indexed fields. One is called number and is (perhaps oddly) treated as a "text" type field meaning its contents will be treated as a string and chopped into individual words in the index (where words are expected to be separated by punctuation like whitespace). The original string will also be indexed as-is in a field called number.keyword which is the field name you should use in your aggregation.
However- given your field is called number I expect you'd be better served mapping this as type long or some other suitable numeric type to ensure operations like max work correctly.
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.