Changeset 31571 for other-projects

Show
Ignore:
Timestamp:
03.04.2017 23:23:59 (2 years ago)
Author:
davidb
Message:

Simple search-all-langs feature added

Location:
other-projects/hathitrust/wcsa/extracted-features-solr/trunk/web-portal
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • other-projects/hathitrust/wcsa/extracted-features-solr/trunk/web-portal/index.html

    r31570 r31571  
    172172        <input type="text"   class="search-in-progress" id="q" name="q" style="width: 600px;"/> 
    173173        <input type="submit" class="search-in-progress" id="search-submit" /> 
    174         <br><input type="checkbox" id="group-results-by-id" name="group-results-by-vol" value="on">Group by Volume 
     174        <br> 
     175          <input type="checkbox" id="group-results-by-id" name="group-results-by-vol" value="on">Group by Volume 
     176          <input type="checkbox" id="search-all-langs"    name="search-all-langs"     value="on">Search all Languages 
    175177         
    176178        <div id="pos-fieldsets"> 
  • other-projects/hathitrust/wcsa/extracted-features-solr/trunk/web-portal/index.js

    r31570 r31571  
    406406        for (var li=0; li<langs_without_pos.length; li++) { 
    407407        var lang = langs_without_pos[li]; 
    408         var lang_enabled_id = lang + "-enabled"; 
     408        var lang_enabled_id = lang + "-enabled"; 
    409409        var $lang_enabled_cb = $('#'+lang_enabled_id); 
    410410         
     
    491491 
    492492    group_by_vol_checked = $('#group-results-by-id:checked').length; 
    493  
     493    var search_all_checked = $('#search-all-langs:checked').length; 
     494    console.log("*** search all checked = " + search_all_checked); 
    494495     
    495496    if (q_text === "") { 
     
    500501     
    501502    var fields = []; 
    502     //var langs_with_pos = [ "da", "de", "en", "nl", "pt", "se" ]; 
    503503    var universal_pos_tags = [ "VERB", "NOUN", "ADJ", "ADV", "ADP", "CONJ", "DET", "NUM", "PRT", "X" ]; 
    504504     
     
    514514        var lang_tag_id = lang+"-"+tag+"-htrctoken-cb"; 
    515515        var $lang_tag_cb = $('#'+lang_tag_id); 
    516         if ($lang_tag_cb.is(':checked')) { 
    517             //var lang_tag_field = "xxxx"+lang+"_"+tag+"_htrctoken"; 
     516        if (search_all_checked || ($lang_tag_cb.is(':checked'))) {           
    518517            var lang_tag_field = lang+"_"+tag+"_htrctoken"; 
    519518            fields.push(lang_tag_field+":"+q_text); 
     
    528527    var $lang_enabled_cb = $('#'+lang_enabled_id); 
    529528 
    530     if ($lang_enabled_cb.is(':checked')) { 
     529    if (search_all_checked || ($lang_enabled_cb.is(':checked'))) { 
    531530        console.log("Adding in non-POS field for: " + lang); 
    532         //var lang_tag_field = "xxxx"+lang+"_htrctoken"; 
    533531        var lang_tag_field = lang+"_htrctoken"; 
    534532        fields.push(lang_tag_field+":"+q_text);      
     
    537535 
    538536    if (fields.length == 0) { 
     537    $('.search-in-progress').css("cursor","auto"); 
    539538    alert("No languages selected"); 
    540539    return;