<commit_before>'use strict';

var sp = sp || {};

angular.module('schooldataApp')
    .controller('MainCtrl', ['$scope', '$http', '$location', '$window', 'es', 'mapService', function ($scope, $http, $location, $window, es, mapService) {

        es.search({
            index: sp.config.elasticsearch.index,
            type: 'district',
            body: {
                size: 0,
                aggs: {
                    district: {
                        terms: {
                            field: 'name',
                            size: 0,
                            order: {
                              _term: "asc"
                            }
                        }
                    }
                }
            }
        }).then(function (body) {
            var districts = [];
            angular.forEach(body.aggregations.district.buckets, function(v){
                districts.push(v.key);
            });
            $scope.districts = districts;
        }, function (error) {
            console.trace(error.message);
        });

        es.search({
            index: sp.config.elasticsearch.index,
            type: 'school',
            body: {
                size: 0,
                aggs: {
                    branches: {
                        terms: {
                            field: 'branches',
                            size: 0,
                            order: {
                              _term: "asc"
                            }
                        }
                    }
                } 
            }
        }).then(function (body) {
            var branches = [];
            angular.forEach(body.aggregations.branches.buckets, function(v){
                branches.push(v.key);
            });
            $scope.schoolTypes = branches;
        }, function (error) {
            console.log(error.message);
        });

        es.search({
            index: sp.config.elasticsearch.index,
            type: 'school',
            body: {
                size: 0,
                aggs: {
                    languages: {
                        terms: {
                            field: 'languages',
                            size: 0,
                            order: {
                              _term: "asc"
                            }
                        }
                    }<commit_msg>Don't mixup school type and branch<commit_after>'use strict';

var sp = sp || {};

angular.module('schooldataApp')
    .controller('MainCtrl', ['$scope', '$http', '$location', '$window', 'es', 'mapService', function ($scope, $http, $location, $window, es, mapService) {

        es.search({
            index: sp.config.elasticsearch.index,
            type: 'district',
            body: {
                size: 0,
                aggs: {
                    district: {
                        terms: {
                            field: 'name',
                            size: 0,
                            order: {
                              _term: "asc"
                            }
                        }
                    }
                }
            }
        }).then(function (body) {
            var districts = [];
            angular.forEach(body.aggregations.district.buckets, function(v){
                districts.push(v.key);
            });
            $scope.districts = districts;
        }, function (error) {
            console.trace(error.message);
        });

        es.search({
            index: sp.config.elasticsearch.index,
            type: 'school',
            body: {
                size: 0,
                aggs: {
                    schooltypes: {
                        terms: {
                            field: 'schooltype',
                            size: 0,
                            order: {
                              _term: "asc"
                            }
                        }
                    }
                } 
            }
        }).then(function (body) {
            var schooltype = [];
            angular.forEach(body.aggregations.schooltypes.buckets, function(v){
                schooltype.push(v.key);
            });
            $scope.schoolTypes = schooltype;
        }, function (error) {
            console.log(error.message);
        });

        es.search({
            index: sp.config.elasticsearch.index,
            type: 'school',
            body: {
                size: 0,
                aggs: {
                    languages: {
                        terms: {
                            field: 'languages',
                            size: 0,
                            order: {
                              _term: "asc"
                            }
                        }
                    }
{'fraction_non_alphanumeric': 0.10810247865028119, 'fraction_numerical': 0.0024994792751510102, 'mean_word_length': 0.7576866764275256, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3209998', 'n_tokens_mistral': 1149, 'n_tokens_neox': 1080, 'n_words': 201}