<commit_before><%inherit file="base.mako"/>
<%def name="title()">Search</%def>
<%def name="content()">
<section id="Search" xmlns="http://www.w3.org/1999/html">
    <div class="page-header">
        % if query:
##            split on and, so we will be able to remove tags
            <%
                cleaned_query = 'AND'.join(query.split('AND'))
                components = cleaned_query.split('AND')
            %>
        <h1>Search <small> for
##            for showing tags
            % for i, term in enumerate(components):
##              the first is not removable. we need it to query
                    <span class="label label-success btn-mini" style="margin-right:.5em">${term.replace('(', ' ').replace(')',' ')}\
                        % if len(components) > 1:
                        <a href="/search/?q=${'AND'.join((x for x in components if x != term)) | h }" style="color:white">&times;</a>
                        % endif
<%                %></span>
            % endfor
         <br>
##       number of results returned and the time it took
        ${total} result${'s' if total is not 1 else ''} in ${time} seconds</small></h1>
        % endif
##      if solr returned a spellcheck, display it
        % if spellcheck:
           <h4> Did you mean <a href='/search/?q=${spellcheck}'> ${spellcheck} </a>? </h4>
        % endif
    </div><!-- end page-header -->
</section>
<div class="row">
    <div class="col-md-2">
        % if query:
            % if isinstance(counts, dict):
        <h4>
                <a href="/search/?q=user:(${query.replace('user:(','').replace(')', '').replace('project:(','').replace('component:(','').replace('registration:(', '') | h})">Users: ${counts['users']}</a>
        </h4><h4>
                <a href="/search/?q=project:(${query.replace('user:(','').replace(')', '').replace('project:(','').replace('component:(','').replace('registration:(', '')})">Projects: ${counts['projects']}</a>
        </h4><h4>
                <a href="/search/?q=component:(${query.replace('user:(','').replace(')', '').replace('project:(','').replace('component:(','').replace('registration:(', '')})">Components: ${counts['components']}</a> 
        </h4><h4>
                <a href="/search/?q=registration:(${query.replace('user:(','').replace(')', '').replace('project:(','').replace('component:(','').replace('registration:(', '')})">Registrations: ${counts['registrations']}</a> 
        </h4>

            % endif
        % else:
        <h3>Searching users</h3>
        % endif
##        our tag cloud!
        % if tags:
        <h3> Improve Your Search:</h3>
            % for key, value in tags.iteritems():
                % if not (u' tags:"{s}"'.format(s=key) in components or u' tags:"{s}" '.format(s=key) in components):
                    <span id="tagCloud">
                    <a href="/search/?q=${query|h} AND tags:&quot;${key}&quot;" rel=${value}> ${key} </a>
                    </span>
                % endif
            % endfor
        % endif
    </div><!-- end col-md -->
    <div class="col-md-10">
            % if results:
##            iterate through our nice lists of results
                % for result in results:
                    <div class="result"><commit_msg>Tags are no longer removed from search when searching anything but users (bug)<commit_after><%inherit file="base.mako"/>
<%def name="title()">Search</%def>
<%def name="content()">
<section id="Search" xmlns="http://www.w3.org/1999/html">
    <div class="page-header">
        % if query:
##            split on and, so we will be able to remove tags
            <%
                cleaned_query = 'AND'.join(query.split('AND'))
                components = cleaned_query.split('AND')
            %>
        <h1>Search <small> for
##            for showing tags
            % for i, term in enumerate(components):
##              the first is not removable. we need it to query
                    <span class="label label-success btn-mini" style="margin-right:.5em">${term.replace('(', ' ').replace(')',' ')}\
                        % if len(components) > 1:
                        <a href="/search/?q=${'AND'.join((x for x in components if x != term)) | h }" style="color:white">&times;</a>
                        % endif
<%                %></span>
            % endfor
         <br>
##       number of results returned and the time it took
        ${total} result${'s' if total is not 1 else ''} in ${time} seconds</small></h1>
        % endif
##      if solr returned a spellcheck, display it
        % if spellcheck:
           <h4> Did you mean <a href='/search/?q=${spellcheck}'> ${spellcheck} </a>? </h4>
        % endif
    </div><!-- end page-header -->
</section>
<div class="row">
    <div class="col-md-2">
        % if query:
            % if isinstance(counts, dict):
        <h4>
                <a href="/search/?q=user:(${query.replace('user:(','').replace(')', '').replace('project:(','').replace('component:(','').replace('registration:(', '') | h})">Users: ${counts['users']}</a>
        </h4><h4>
                <a href="/search/?q=project:(${query.replace('user:(','').replace(')', '').replace('project:(','').replace('component:(','').replace('registration:(', '') | h})">Projects: ${counts['projects']}</a>
        </h4><h4>
                <a href="/search/?q=component:(${query.replace('user:(','').replace(')', '').replace('project:(','').replace('component:(','').replace('registration:(', '') | h})">Components: ${counts['components']}</a> 
        </h4><h4>
                <a href="/search/?q=registration:(${query.replace('user:(','').replace(')', '').replace('project:(','').replace('component:(','').replace('registration:(', '') | h})">Registrations: ${counts['registrations']}</a> 
        </h4>

            % endif
        % else:
        <h3>Searching users</h3>
        % endif
##        our tag cloud!
        % if tags:
        <h3> Improve Your Search:</h3>
            % for key, value in tags.iteritems():
                % if not (u' tags:"{s}"'.format(s=key) in components or u' tags:"{s}" '.format(s=key) in components):
                    <span id="tagCloud">
                    <a href="/search/?q=${query|h} AND tags:&quot;${key}&quot;" rel=${value}> ${key} </a>
                    </span>
                % endif
            % endfor
        % endif
    </div><!-- end col-md -->
    <div class="col-md-10">
            % if results:
##            iterate through our nice lists of results
                % for result in results:
                    <div class="result">
{'fraction_non_alphanumeric': 0.21427486712224753, 'fraction_numerical': 0.008200455580865604, 'mean_word_length': 2.1317165953399906, 'pattern_counts': {'":': 0, '<': 111, '<?xml version=': 0, '>': 113, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, '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': '2204468', 'n_tokens_mistral': 2034, 'n_tokens_neox': 1910, 'n_words': 441}