I am trying to calculate the total number of times a particular term occurs throughout an entire index (term collection frequency). I have attempted to do so through the use of
I believe you need to turn term_statistics to true as per elasticsearch documentation:
Term statistics Setting term_statistics to true (default is false) will return
total term frequency (how often a term occurs in all documents)
document frequency (the number of documents containing the current term)
By default these values are not returned since term statistics can have a serious performance impact.