From 81f1970f3da2e5cdadc2280befb4a5c4943503b0 Mon Sep 17 00:00:00 2001 From: Paul Pound Date: Fri, 14 Jul 2017 15:22:49 -0300 Subject: [PATCH] added bundle name and totol results found to solr result target --- .../solr_site/css/roblib_search_solr_site.css | 19 ++++++++++++++++++- targets/solr_site/js/solr_site_results.js | 11 ++++++----- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/targets/solr_site/css/roblib_search_solr_site.css b/targets/solr_site/css/roblib_search_solr_site.css index 594c4ae..cb4cb5a 100755 --- a/targets/solr_site/css/roblib_search_solr_site.css +++ b/targets/solr_site/css/roblib_search_solr_site.css @@ -1,4 +1,4 @@ -/* +/* Document : roblib_search_evergreen Created on : Apr 11, 2013, 2:27:50 PM Author : ppound @@ -7,3 +7,20 @@ */ +.solr-site-results { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + word-wrap: break-word; + margin-right: 5px; + width: 100%; +} + + +.roblib-solr-bundle { + font-weight: lighter; + color: gray; +} + + + diff --git a/targets/solr_site/js/solr_site_results.js b/targets/solr_site/js/solr_site_results.js index afb3b97..94d234c 100644 --- a/targets/solr_site/js/solr_site_results.js +++ b/targets/solr_site/js/solr_site_results.js @@ -6,6 +6,7 @@ Drupal.behaviors.roblib_search_solr_site_results = { default_site_type = settings.roblib_search_solr_site_results.default_site_type + '/'; jQuery.getJSON(url, function(data) { var items = []; + total_found = data.response.numFound; var numberOfDocs = 0; try { numberOfDocs = data.response.docs.length; @@ -16,7 +17,6 @@ Drupal.behaviors.roblib_search_solr_site_results = { jQuery('#' + 'roblib-search-content-solr-site-results').empty().append('No Results'); jQuery('.' + 'pane-roblib-search-solr-site-roblib-search-solr-site-results').hide(); } else { - jQuery('#' + 'roblib-search-content-solr-site-results').empty(); var counter = 0; var divs = new Array(); @@ -26,15 +26,16 @@ Drupal.behaviors.roblib_search_solr_site_results = { content[counter] = val.teaser; divs[counter++] = id; items.push('
\n\ -
'); + \n\ + ' + val.label + '' + + '\n\(' + val.bundle_name + ') ' + val.teaser + ''); }); - jQuery('#' + 'roblib-search-content-solr-site-results').empty().append(items.join('')); } if (numberOfDocs > 0) { - jQuery('#' + 'roblib-search-solr-site-results-more').empty().append('see all results'); + jQuery('#' + 'roblib-search-solr-site-results-more').empty().append('see all results (' + + total_found + ') '); } }); }