<commit_before>define(['app','underscore','/app/js/common.js',
    'introjs','scbd-angularjs-services', 'scbd-angularjs-filters', 'scbd-angularjs-controls',
    '/app/views/forms/view/record-loader.directive.html.js',
    '/app/views/search/find_schemas.partial.html.js',
    '/app/views/search/find_countries.partial.html.js',
    '/app/views/search/search-filter-regions.js',
    '/app/views/search/find_facets.partial.html.js',
    '/app/views/search/find_themes.partial.html.js',
    '/app/views/directives/search-filter-dates.partial.html.js',
    '/app/views/directives/document-list.partial.html.js', 'bootstrap-datepicker','moment',
    '/app/views/directives/help-directive.html.js',
    '/app/views/search/search-directives/search-national-records-filter-directive.html.js',
    '/app/views/countries/country-map-list-directive.html.js', '/app/services/search-service.js'],
     function (app,_) {

    app.controller('FindController', ['$scope', '$rootScope','showHelp' ,'$http', '$timeout', '$q','realm', '$routeParams',
        '$location','$element','commonjs','$mdSidenav', '$mdUtil', '$mdMedia', 'searchService',
        function ($scope, $rootScope,showHelp, $http, $timeout, $q, realm, $routeParams,$location,
            $element, commonjs, $mdSidenav, $mdUtil, $mdMedia, searchService) {

        var self = this;
        var queryCanceler = null;
        var refreshTimeout = null;

        $scope.orderReferenceBy = "title_s acs";
        $scope.itemsPerPage    = 25;
        $scope.documentCount   = 0;
        $scope.currentPage     = 0;

        $scope.querySchema     = '*:*';
        $scope.queryGovernment = '*:*';
        $scope.queryTheme      = '*:*';
        $scope.queryRegion      = '*:*';
        $scope.queryKeywords   = '*:*';
        $scope.displayDetails = false;
        $scope.countryResultFilter = [];
        $scope.queryPartyStatus = '';

        $scope.previewType = 'group';
        $scope.sortBy = '';
        $scope.rawDocs = [];

        //============================================================
        //
        //
        //============================================================
        $scope.clearFilter = function(){

            $scope.keyword = "";
            $scope.queryPartyStatus = "";
            $scope.partyStatusString = undefined;
            $scope.queryGovernment = undefined;
            $scope.$broadcast("clearFilter",{});
        }

        $scope.$watch('querySchema',     function() { $scope.currentPage=0; refresh(); });
        $scope.$watch('queryGovernment', function() { $scope.currentPage=0; refresh(); });
        $scope.$watch('queryTargets',    function() { $scope.currentPage=0; refresh(); });
        $scope.$watch('queryTheme',      function() { $scope.currentPage=0; refresh(); });
        $scope.$watch('queryRegion',     function() { $scope.currentPage=0; refresh(); });
        $scope.$watch('queryDate',       function() { $scope.currentPage=0; refresh(); });
        $scope.$watch('keyword',         function() { $scope.currentPage=0; refresh(); });
        $scope.$watch('orderReferenceBy',function() { $scope.currentPage=0; refresh(); });
        $scope.$watch('previewType',     function(newValue, oldValue) {
            if(newValue && oldValue && $scope.rawDocs){
                $scope.rawDocs = undefined;
                $scope.documentCount = 0;

                if($scope.currentPage>0)
                    $scope.currentPage=0;
                else
                    refresh();
            }
        });

        $scope.updatePreviewType = function(type){
            $scope.previewType=type;
            $scope.rawDocs = undefined;
        }

        $scope.removeFilter = function(filter){
            $scope.$broadcast('removeFilter',{data:filter});
        }
        $scope.removeCountryFilter = function(filter){
            $scope.countryApi.unSelectItem(filter.code);<commit_msg>Update search.html.js<commit_after>define(['app','underscore','/app/js/common.js',
    'introjs','scbd-angularjs-services', 'scbd-angularjs-filters', 'scbd-angularjs-controls',
    '/app/views/forms/view/record-loader.directive.html.js',
    '/app/views/search/find_schemas.partial.html.js',
    '/app/views/search/find_countries.partial.html.js',
    '/app/views/search/search-filter-regions.js',
    '/app/views/search/find_facets.partial.html.js',
    '/app/views/search/find_themes.partial.html.js',
    '/app/views/directives/search-filter-dates.partial.html.js',
    '/app/views/directives/document-list.partial.html.js', 'bootstrap-datepicker','moment',
    '/app/views/directives/help-directive.html.js',
    '/app/views/search/search-directives/search-national-records-filter-directive.html.js',
    '/app/views/countries/country-map-list-directive.html.js', '/app/services/search-service.js'],
     function (app,_) {

    app.controller('FindController', ['$scope', '$rootScope','showHelp' ,'$http', '$timeout', '$q','realm', '$routeParams',
        '$location','$element','commonjs','$mdSidenav', '$mdUtil', '$mdMedia', 'searchService',
        function ($scope, $rootScope,showHelp, $http, $timeout, $q, realm, $routeParams,$location,
            $element, commonjs, $mdSidenav, $mdUtil, $mdMedia, searchService) {

        var self = this;
        var queryCanceler = null;
        var refreshTimeout = null;

        $scope.orderReferenceBy = "title_s acs";
        $scope.itemsPerPage    = 25;
        $scope.documentCount   = 0;
        $scope.currentPage     = 0;

        $scope.querySchema     = '*:*';
        $scope.queryGovernment = '*:*';
        $scope.queryTheme      = '*:*';
        $scope.queryRegion      = '*:*';
        $scope.queryKeywords   = '*:*';
        $scope.displayDetails = false;
        $scope.countryResultFilter = [];
        $scope.queryPartyStatus = '';

        $scope.previewType = 'group';
        $scope.sortBy = '';
        $scope.rawDocs = [];

        //============================================================
        //
        //
        //============================================================
        $scope.clearFilter = function(){

            $scope.keyword = "";
            $scope.queryPartyStatus = "";
            $scope.partyStatusString = undefined;
            $scope.queryGovernment = undefined;
            $scope.$broadcast("clearFilter",{});
        }

        $scope.$watch('currentPage',     function() {
            refresh();
        });
        $scope.$watch('querySchema',     function() { $scope.currentPage=0; refresh(); });
        $scope.$watch('queryGovernment', function() { $scope.currentPage=0; refresh(); });
        $scope.$watch('queryTargets',    function() { $scope.currentPage=0; refresh(); });
        $scope.$watch('queryTheme',      function() { $scope.currentPage=0; refresh(); });
        $scope.$watch('queryRegion',     function() { $scope.currentPage=0; refresh(); });
        $scope.$watch('queryDate',       function() { $scope.currentPage=0; refresh(); });
        $scope.$watch('keyword',         function() { $scope.currentPage=0; refresh(); });
        $scope.$watch('orderReferenceBy',function() { $scope.currentPage=0; refresh(); });
        $scope.$watch('previewType',     function(newValue, oldValue) {
            if(newValue && oldValue && $scope.rawDocs){
                $scope.rawDocs = undefined;
                $scope.documentCount = 0;

                if($scope.currentPage>0)
                    $scope.currentPage=0;
                else
                    refresh();
            }
        });

        $scope.updatePreviewType = function(type){
            $scope.previewType=type;
            $scope.rawDocs = undefined;
        }

        $scope.removeFilter = function(filter){
            $scope.$broadcast('removeFilter',{data:filter});
        }
        $scope.removeCountryFilter = function(filter){
            $scope.countryApi.unSelectItem(filter.code);
{'fraction_non_alphanumeric': 0.20164452877925362, 'fraction_numerical': 0.003795066413662239, 'mean_word_length': 2.596906278434941, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '903481', 'n_tokens_mistral': 2315, 'n_tokens_neox': 2232, 'n_words': 283}