<commit_before>// Create an Angular module for this plugin
import { uiModules } from 'ui/modules';
var module = require('ui/modules').get('relational_filter');
import { FilterBarQueryFilterProvider } from 'ui/filter_bar/query_filter';

module.controller('relationalFilterController', function($scope, Private) {

    //var filterManager = Private(require('ui/filter_manager'));
    const queryFilter = Private(FilterBarQueryFilterProvider);
    var haltKeyPressed = 0;

    $(document).on("keydown focus load", function(e) {
        if (e.keyCode == 16 || e.keyCode == 17) {
            haltKeyPressed = 1;
            console.log('Document ' + e.keyCode + ' haltKeyPressed: ' + haltKeyPressed);
        } else {
            haltKeyPressed = 0;
        };
    });
    $(document).on("keyup", function(e) {

        haltKeyPressed = 0;
        console.log('Document ' + e.keyCode + ' haltKeyNotPressed: ' + haltKeyPressed);

    });

    $scope.onKeyUp = function(keyEvent) {
        console.log('onKeyUp');
        if (keyEvent.which === 16 || keyEvent.which === 17) {
            haltKeyPressed = 0;
            console.log('Up haltKeyPressed: ' + haltKeyPressed);
            keyEvent.stopPropagation();
            $scope.filter_menu_multiple();
        }
    }

    $scope.onLostFocus = function(keyEvent) {
        console.log('onLostFocus');
        haltKeyPressed = 0;
        keyEvent.stopPropagation();
        $scope.filter_menu_multiple();
    }

    $scope.create_filter = function(tag) {
        console.log("Creating the filter");
        const newFilters = [];
        let filter;
        let alias, field, internal_query;
        alias = $scope.vis.aggs.bySchemaName['filterDisplay'][0]['params']['field']['name'].replace(".keyword", "");
        field = $scope.vis.aggs.bySchemaName['filterValue'][0]['params']['field']['name'];
        console.log(field);
        console.log(tag);
        console.log($scope.vis.params.emptyValue);

        filter = {};<commit_msg>Default value for the filter<commit_after>// Create an Angular module for this plugin
import { uiModules } from 'ui/modules';
var module = require('ui/modules').get('relational_filter');
import { FilterBarQueryFilterProvider } from 'ui/filter_bar/query_filter';

module.controller('relationalFilterController', function($scope, Private) {

    //var filterManager = Private(require('ui/filter_manager'));
    const queryFilter = Private(FilterBarQueryFilterProvider);
    var haltKeyPressed = 0;

    $(document).on("keydown focus load", function(e) {
        if (e.keyCode == 16 || e.keyCode == 17) {
            haltKeyPressed = 1;
            console.log('Document ' + e.keyCode + ' haltKeyPressed: ' + haltKeyPressed);
        } else {
            haltKeyPressed = 0;
        };
    });
    $(document).on("keyup", function(e) {

        haltKeyPressed = 0;
        console.log('Document ' + e.keyCode + ' haltKeyNotPressed: ' + haltKeyPressed);

    });

    $scope.onKeyUp = function(keyEvent) {
        console.log('onKeyUp');
        if (keyEvent.which === 16 || keyEvent.which === 17) {
            haltKeyPressed = 0;
            console.log('Up haltKeyPressed: ' + haltKeyPressed);
            keyEvent.stopPropagation();
            $scope.filter_menu_multiple();
        }
    }

    $scope.onLostFocus = function(keyEvent) {
        console.log('onLostFocus');
        haltKeyPressed = 0;
        keyEvent.stopPropagation();
        $scope.filter_menu_multiple();
    }

    $scope.create_filter = function(tag) {
        console.log("Creating the filter");
        const newFilters = [];
        let filter;
        let alias, field, internal_query;
        alias = $scope.vis.aggs.bySchemaName['filterDisplay'][0]['params']['field']['name'].replace(".keyword", "");
        field = $scope.vis.aggs.bySchemaName['filterValue'][0]['params']['field']['name'];
        console.log(field);
        console.log(tag);
        console.log($scope.vis.params.emptyValue);

        filter = {'meta':{'type':'query'}};
{'fraction_non_alphanumeric': 0.15177234148776836, 'fraction_numerical': 0.00798801797304044, 'mean_word_length': 2.8271251193887297, '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': '2631732', 'n_tokens_mistral': 1205, 'n_tokens_neox': 1165, 'n_words': 205}