<commit_before>﻿@{
    Layout = "~/en_US/_SiteLayout.cshtml";
    Page.Title = "Search Results...";
    
    /* Getting search parameters */
    var serviceType = PageData["serviceType"] = Request["serviceType"];
    var serviceCat = PageData["serviceCat"] = Request["service"];
    var serviceLocation = PageData["serviceLocation"] = Request["serviceLocation"];
    var serviceDate = PageData["serviceDate"] = Request["serviceDate"];

    /* Model Code: accesing database to perform search */
    // Building sql parameters:
    var LC_Term  = "%" + serviceType + "%";
    var LC_Cat = serviceCat;
    // Performing search:
    var db = Database.Open("sqlloco");
    var searchsql = "EXEC dbo.GetSearchResults @0,@1,@2,@3";
    var posrow = db.Query(searchsql, 1, 1, LC_Term, LC_Cat);
    
    bool categorizedResults = (String.IsNullOrEmpty(serviceCat) ? false : true);
    
    /* Simulating categorized search */
    var searchedCategories = new string[]{ "Housekeepers", "Handymen", "Gardeners", "Electricians", "Plumbers", "Painters" };
}

<div id="container" class="search clearfix">
    <div id="main">
        @RenderPage("_Categories.cshtml")
        
        @RenderPage("_Pager.cshtml")
        
        <div class="search-results">
            @if(categorizedResults){
            <ol class="search-results-categories">
                @foreach(var scat in searchedCategories){
                <li>
                    <h3>@scat</h3>
                    <a class="view-more" href="?Service=@scat">View all @scat</a>
                    <ol class="search-results-items">
                        @foreach(var item in posrow){
                            PageData["item"] = item;
                        <li>
                            @RenderPage("_Item.cshtml")<commit_msg>Reducing number of results by category to 1 at categorized search.<commit_after>﻿@{
    Layout = "~/en_US/_SiteLayout.cshtml";
    Page.Title = "Search Results...";
    
    /* Getting search parameters */
    var serviceType = PageData["serviceType"] = Request["serviceType"];
    var serviceCat = PageData["serviceCat"] = Request["service"];
    var serviceLocation = PageData["serviceLocation"] = Request["serviceLocation"];
    var serviceDate = PageData["serviceDate"] = Request["serviceDate"];

    /* Model Code: accesing database to perform search */
    // Building sql parameters:
    var LC_Term  = "%" + serviceType + "%";
    var LC_Cat = serviceCat;
    // Performing search:
    var db = Database.Open("sqlloco");
    var searchsql = "EXEC dbo.GetSearchResults @0,@1,@2,@3";
    var posrow = db.Query(searchsql, 1, 1, LC_Term, LC_Cat);
    
    bool categorizedResults = (String.IsNullOrEmpty(serviceCat) ? false : true);
    
    /* Simulating categorized search */
    var searchedCategories = new string[]{ "Housekeepers", "Handymen", "Gardeners", "Electricians", "Plumbers", "Painters" };
}

<div id="container" class="search clearfix">
    <div id="main">
        @RenderPage("_Categories.cshtml")
        
        @RenderPage("_Pager.cshtml")
        
        <div class="search-results">
            @if(categorizedResults){
                // hacking the results to emulate a search
                var n = 0;
            <ol class="search-results-categories">
                @foreach(var scat in searchedCategories){
                    // hacking the results to emulate a search
                    n++;
                    var i = 0;
                <li>
                    <h3>@scat</h3>
                    <a class="view-more" href="?Service=@scat">View all @scat</a>
                    <ol class="search-results-items">
                        @foreach(var item in posrow){
                            // hacking the results to emulate a search
                            i++;
                            if(n!=i){continue;}
                            PageData["item"] = item;
                        <li>
                            @RenderPage("_Item.cshtml")
{'fraction_non_alphanumeric': 0.13309894525364138, 'fraction_numerical': 0.004771471622300351, 'mean_word_length': 2.0852052672347017, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, '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': '5272448', 'n_tokens_mistral': 1139, 'n_tokens_neox': 1083, 'n_words': 259}