def item_frequencies(self, list_field, normalize=False):
        freq_func = """
            function(listField) {
                if (options.normalize) {
                    var total = 0.0;
                    db[collection].find(query).forEach(function(doc) {
                        total += doc[listField].length;
                    });
                }

                var frequencies = {};
                var inc = 1.0;
                if (options.normalize) {
                    inc /= total;
                }
                db[collection].find(query).forEach(function(doc) {
                    doc[listField].forEach(function(item) {
                        frequencies[item] = inc + (frequencies[item] || 0);
                    });
                });
                return frequencies;
            }
        """
        return self.exec_js(freq_func, list_field, normalize=normalize)
Returns a dictionary of all items present in a list field across
dataset/ETHPy150Open aparo/django-elasticsearch/django_elasticsearch/manager.py/QuerySet.item_frequencies