Terms aggregation bucket Sorting is not working when using with partition

This comment with links may be of use