<commit_before><?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

require_once('skylight.php');

class Browse extends skylight {

    function Browse() {
        // Initalise the parent
        parent::__construct();
    }

    function _remap($field, $params = array()) {
        if ((empty($field)) || ($field == 'index')) {

        }

        $configured_filters = $this->config->item('skylight_filters');
        $delimiter = $this->config->item('skylight_filter_delimiter');
        $rows = 30;
        $recorddisplay = $this->config->item('skylight_recorddisplay');
     //   $title = $recorddisplay['Title'];

        $saved_filters = array();
        $url_filters = array();
        if(count($this->uri->segments) > 2) {

            for($i = 3; $i <= count($this->uri->segments); $i++) {

                $test_filter = $this->uri->segments[$i];
                $url_filters[] = $test_filter;
                $filter_segments = preg_split("/$delimiter/",$test_filter, 2);
                if(array_key_exists($filter_segments[0], $configured_filters)) {
                    $saved_filters[] = $configured_filters[$filter_segments[0]].$delimiter.$filter_segments[1];
                }
            }
        }


        $offset = $this->input->get('offset');
        $prefix = $this->input->get('prefix');
       // echo "PREFIX IS $prefix";


        // Base search URL
        $base_search = './search/*';
        foreach($url_filters as $url_filter) {
            $base_search .= '/'.$url_filter;
        }


        // Solr query business moved to solr_client library
        $data = $this->solr_client->browseTerms($field, $rows, $offset, $prefix);

        // Check for zero results
        $result_count = $data['rows'];
        $facet_count = $data['facet']['termcount'];

        if ($result_count == 0) {
            $data['page_title'] = 'No search results found!';
            $this->view('header', $data);
            $this->view('div_main');
            $this->view('search_noresults');
            $this->view('div_main_end');
            $this->view('div_sidebar');
            $this->view('div_sidebar_end');
            $this->view('footer');
            return;
        }<commit_msg>related items<commit_after><?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

require_once('skylight.php');

class Browse extends skylight {

    function Browse() {
        // Initalise the parent
        parent::__construct();
    }

    function _remap($field, $params = array()) {
        if ((empty($field)) || ($field == 'index')) {

        }

        $configured_filters = $this->config->item('skylight_filters');
        $delimiter = $this->config->item('skylight_filter_delimiter');
        $rows = 30;
        $recorddisplay = $this->config->item('skylight_recorddisplay');
     //   $title = $recorddisplay['Title'];

        $saved_filters = array();
        $url_filters = array();
        if(count($this->uri->segments) > 2) {

            for($i = 3; $i <= count($this->uri->segments); $i++) {

                $test_filter = $this->uri->segments[$i];
                $url_filters[] = $test_filter;
                $filter_segments = preg_split("/$delimiter/",$test_filter, 2);
                if(array_key_exists($filter_segments[0], $configured_filters)) {
                    $saved_filters[] = $configured_filters[$filter_segments[0]].$delimiter.$filter_segments[1];
                }
            }
        }


        $offset = $this->input->get('offset');
        $prefix = $this->input->get('prefix');
<<<<<<< HEAD
       // echo "PREFIX IS $prefix";
=======
        //echo "PREFIX IS $prefix";
>>>>>>> cdf27dfac302a15ce767d38ad9bd0f142c30baac


        // Base search URL
        $base_search = './search/*';
        foreach($url_filters as $url_filter) {
            $base_search .= '/'.$url_filter;
        }


        // Solr query business moved to solr_client library
        $data = $this->solr_client->browseTerms($field, $rows, $offset, $prefix);

        // Check for zero results
        $result_count = $data['rows'];
        $facet_count = $data['facet']['termcount'];

        if ($result_count == 0) {
            $data['page_title'] = 'No search results found!';
            $this->view('header', $data);
            $this->view('div_main');
            $this->view('search_noresults');
            $this->view('div_main_end');
            $this->view('div_sidebar');
            $this->view('div_sidebar_end');
            $this->view('footer');
            return;
        }
{'fraction_non_alphanumeric': 0.17424573677306515, 'fraction_numerical': 0.008089199825098382, 'mean_word_length': 2.228652081863091, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 62, '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': '3726521', 'n_tokens_mistral': 1409, 'n_tokens_neox': 1345, 'n_words': 235}