Index: other-projects/hathitrust/wcsa/extracted-features-solr/trunk/web-portal/index.html
===================================================================
--- other-projects/hathitrust/wcsa/extracted-features-solr/trunk/web-portal/index.html	(revision 31685)
+++ other-projects/hathitrust/wcsa/extracted-features-solr/trunk/web-portal/index.html	(revision 31693)
@@ -171,5 +171,5 @@
 		<input type="hidden" id="wt" name="wt" value="json"/>
 		<input type="hidden" id="start" name="start" value="0"/>
-		<input type="hidden" id="rows" name="rows" value="20"/>
+		<input type="hidden" id="rows" name="rows" value="200"/>
 
 		<!--
@@ -191,9 +191,41 @@
 		    <td></td>
 		    <td style="color: #aaaaaa; width: 400px; font-size: 14px; line-height: 16px; padding-bottom: 10px;">
-		      Indexed volume metadata fields: accessProfile_t, genre_t,
+		      Indexed volume metadata fields:
+		      <!--
+		      accessProfile_t, genre_t,
 		      imprint_t, isbn_t, issn_t, issuance_t,
 		      language_t, lccn_t, names_t, oclc_t,
 		      pubPlace_t, pubDate_t, rightsAttributes_t,
 		      title_t, typeOfResource_t
+-->
+
+		      accessProfile_t,
+		      bibliographicFormat_t,
+		      classification_dcc_t,
+		      classification_lcc_t,
+		      dateCreated_t,              
+		      genre_t,
+		      handleUrl_t,
+		      hathitrustRecordNumber_t,  
+		      htBibUrl_t,
+		      imprint_t,
+      		      isbn_t,
+		      issn_t,
+		      issuance_t,
+		      language_t,
+		      lastUpdateDate_t,		      
+      		      lccn_t,
+      		      names_t,
+		      oclc_t,
+		      pubDate_t,
+		      pubPlace_t,
+		      rightsAttributes_t,
+		      schemaVersion_t,
+		      sourceInstitution_t,
+		      sourceInstitutionRecordNumber_t,
+		      title_t,
+		      typeOfResource_t,
+		      volumeIdentifier_t
+		      
 		    </td>
 		  </tr>
@@ -203,8 +235,11 @@
 		      <input type="text"   class="search-in-progress" id="q" name="q"
 			     style="width: 600px;"/><br />
-		      <input type="checkbox" id="group-results-by-id" name="group-results-by-vol" value="on">&nbsp;<span>Group by Volume</span>
+		      <input type="checkbox" id="group-results-by-vol" name="group-results-by-vol" value="on">&nbsp;<span>Group by Volume</span>
 
 		    </td>
 		  </tr>
+		  <!-- example facet query
+		       http://solr1.ischool.illinois.edu/solr/htrc-full-ef20/select?facet.field=genre_ss&facet=on&indent=on&q=title_t:*&rows=0&wt=json&facet.field=issuance_s
+-->
 		  <tr>
 		    <td></td>
@@ -254,8 +289,8 @@
       <h4>Additional Resources</h4>
       <ul>
-	<li><a href="stream-query.html">Combined Volume Metadata and Page-levelPOS Term searching</a></li>
 	<li><a href="admin.html">HTRC-EF Solr Admin UI (log in)</a></li>
 	<li><a href="luke_lang_mappings.html">Dynamically Generated Language Map (Part-of-Speech, and Other)</a></li>
 	<li><a href="/solr/htrc-full-ef20_shard6_replica1/admin/luke">Luke XML on shard</a></li>
+	<li><a href="stream-query.html">Combined Volume Metadata and Page-level POS Term searching (deprecated)</a></li>
       </ul>
     </div>
Index: other-projects/hathitrust/wcsa/extracted-features-solr/trunk/web-portal/index.js
===================================================================
--- other-projects/hathitrust/wcsa/extracted-features-solr/trunk/web-portal/index.js	(revision 31685)
+++ other-projects/hathitrust/wcsa/extracted-features-solr/trunk/web-portal/index.js	(revision 31693)
@@ -64,5 +64,13 @@
     //console.log("****" + JSON.stringify(json_data));
     $.each( json_data["@graph"], function( ws_index, ws_val ) {
+	var workset_id = ws_val["@id"];
 	var workset_title = ws_val["http://purl.org/dc/terms/title"][0]["@value"];
+
+	// http://acbres224.ischool.illinois.edu:8890/sparql?query=describe <http://worksets.hathitrust.org/wsid/189324112>&format=text/x-html+ul
+	// http://acbres224.ischool.illinois.edu:8890/sparql?query=describe+%3Chttp%3A%2F%2Fworksets.hathitrust.org%2Fwsid%2F189324112%3E&format=text%2Fx-html%2Bul
+	
+	var describe_url = "http://acbres224.ischool.illinois.edu:8890/sparql?query=describe+<"
+	    + workset_id + ">&format=text%2Fx-html%2Bul";
+	var hyperlinked_workset_title = '<a target="_blank" href="'+describe_url+'">'+workset_title+'</a>';
 	
 	var gathers = ws_val["http://www.europeana.eu/schemas/edm/gathers"]
@@ -73,10 +81,9 @@
 	    $("[name='"+item_url+"']").each(function() {
 		$(this).parent().show();
-//		if ($(this).find("span").length>1) {
 		if ($(this).children().size()>=1) {
 		    $(this).append("; ");
 		}
 		
-		$(this).append("<span>" + workset_title + "</span>")
+		$(this).append("<span>" + hyperlinked_workset_title + "</span>")
 	    });
 	});
@@ -250,8 +257,18 @@
 
     if (num_docs>0) {
-	$search_results.html("<p>Results: " + num_found + " pages matched</p>");
-	var from = parseInt(store_search_args.start);
-	var to = from + num_rows;
-	$search_results.append("<p>Showing matches: "+from+"-" + to + "</p>");
+	$search_results.html("<p>Results: " + num_found + doc_units + "matched</p>");
+	var from = parseInt(store_search_args.start)+1;
+	var to = from + num_rows -1;
+	if (to>num_found) {
+	    // cap value
+	    to = num_found;
+	}
+	var showing_matches = "<p>Showing matches: ";
+	showing_matches += '<span id="sm-from">'+from+'</span>';
+	showing_matches += "-";
+	showing_matches += '<span id="sm-to">'+to+'</span>';
+	showing_matches += "</p>";
+
+	$search_results.append(showing_matches);
     }
     else {
@@ -268,6 +285,6 @@
     
     var i=0;
-    var line_num = 0;
-    while (i<num_docs) {
+    var line_num = 1;
+    while ((i<num_docs) && (line_num < num_rows)) {
 	var doc = docs[i];
 	var id_and_page = doc.id.split(".page-");
@@ -282,5 +299,5 @@
 	var page = seqnum;
 
-	if ((prev_id != null) && (id != prev_id)) {
+	if ((!group_by_vol_checked && prev_id != null) || ((prev_id != null) && (id != prev_id))) {
 	    // time to output previous item
 	    var html_item = generate_item(line_num,prev_id,prev_pages);
@@ -299,8 +316,20 @@
 	i++;
     }
+    var num_pages = i;
     
     var html_item = generate_item(line_num,prev_id,prev_pages);
-    $search_results.append(html_item);
-
+//    console.log("*** html item = " + html_item);
+//    if (html_item != "") {
+	$search_results.append(html_item);
+//	line_num++;
+//    }
+    console.log("*** line_num = " + line_num);
+    
+    //else {
+//	line_num--;
+  //  }
+//    if ((i == num_docs) && (line_num != num_rows)) {
+//	line_num--;
+//    }
     
     document.location.href="#search-results-anchor";
@@ -312,9 +341,17 @@
     $('#search-next').click(function(event) { show_new_results(num_rows); });
 
-    var search_start = store_search_args.start;
+    var search_start = parseInt(store_search_args.start);
     if (search_start==0) {
 	$('#search-prev').hide();
     }
-    
+
+    var search_end = search_start + num_pages;
+    if (search_end >= num_found) {
+	$('#search-next').hide();
+    }
+
+    $('#sm-to').html(search_start + line_num);
+    
+
     // Example URL for catalog metadata (multiple items)
     //   http://catalog.hathitrust.org/api/volumes/brief/json/id:552;lccn:70628581|isbn:0030110408
@@ -335,4 +372,6 @@
 
 var group_by_vol_checked = 0;
+var doc_units = "";
+
 
 function expand_vfield(q_term,all_vfields)
@@ -507,8 +546,8 @@
     var arg_rows   = $('#rows').attr('value');
 
-    var q_text     = $('#q').val();
-    var vq_text     = $('#vq').val();
-    
-    group_by_vol_checked = $('#group-results-by-id:checked').length;
+    var q_text     = $('#q').val().trim();
+    var vq_text     = $('#vq').val().trim();
+    
+    group_by_vol_checked = $('#group-results-by-vol:checked').length;
 
     var search_all_langs_checked = $('#search-all-langs:checked').length;
@@ -538,4 +577,5 @@
 	else {
 	    arg_q = arg_vq;
+	    doc_units = " volumes ";
 	}
     }
@@ -548,4 +588,5 @@
 	    group_by_vol_checked = true;
 	}
+	doc_units = " pages ";
     }
 
