diff --git a/targets/solr_site/css/roblib_search_solr_site.css b/targets/solr_site/css/roblib_search_solr_site.css old mode 100644 new mode 100755 diff --git a/targets/solr_site/js/solr_site_bestbet.js b/targets/solr_site/js/solr_site_bestbet.js new file mode 100755 index 0000000..f0db3e3 --- /dev/null +++ b/targets/solr_site/js/solr_site_bestbet.js @@ -0,0 +1,30 @@ +Drupal.behaviors.roblib_search_solr_site_bestbet = { + attach: function(context, settings) { + $url = settings.roblib_search_solr_site_bestbet.search_url; + jQuery.getJSON($url, function(data) { + var items = []; + var numberOfDocs = 0; + try { + numberOfDocs = data.response.docs.length; + } catch (err) { + // do nothing leave docLength at 0 + } + if (numberOfDocs < 1) { + jQuery('#' + 'roblib-search-content-solr-site-bestbet').empty().append('No Results'); + } else { + + jQuery('#' + 'roblib-search-content-solr-site-bestbet').empty(); + + jQuery.each(data.response.docs, function(key, val) { + items.push('