Skip to content

Instantly share code, notes, and snippets.

@rom3r4
Last active August 29, 2015 14:06
Show Gist options
  • Save rom3r4/35bbea79891198117ddf to your computer and use it in GitHub Desktop.
Save rom3r4/35bbea79891198117ddf to your computer and use it in GitHub Desktop.
Carrot + Solr integration on ODS site.
<?php
/**
* Modified File to contain ODS graphical Facet Interfaces
*
* @file
* Default theme implementation for displaying search results.
*
* This template collects each invocation of theme_search_result(). This and
* the child template are dependent to one another sharing the markup for
* definition lists.
*
* Note that modules may implement their own search type and theme function
* completely bypassing this template.
*
* Available variables:
* - $search_results: All results as it is rendered through
* search-result.tpl.php
* - $module: The machine-readable name of the module (tab) being searched, such
* as "node" or "user".
*
*
* @see template_preprocess_search_results()
*
* @ingroup themeable
*/2
?>
<?php if ( !empty($response) && strcmp($response->debug->querystring,"") ): // code has a search query and yields results ?>
<?php
print '<iframe width="100%" height="600" style="min-height:600px;height:600px;" seamless="seamless" sandbox="allow-scripts allow-same-origin allow-top-navigation" frameborder="0" src="http://localhost:8983/carrot2/search?source=solr&view=folders&skin=fancy-compact&results=100&algorithm=passthrough&SolrDocumentSource.solrFilterQuery=&SolrDocumentSource.solrTitleFieldName=label&SolrDocumentSource.solrSummaryFieldName=teaser&SolrDocumentSource.solrUrlFieldName=url&SolrDocumentSource.solrIdFieldName=id&SolrDocumentSource.readClusters=true&SolrDocumentSource.useHighlighterOutput=true&query=';
print $response->debug->querystring;
print '"></iframe>';
?>
<ol class="search-results <?php print $module; ?>-results">
<?php print $search_results; ?>
</ol>
<?php print $pager; ?>
<?php else : ?>
<h2><?php print t('Your search yielded no results');?></h2>
<?php print search_help('search#noresults', drupal_help_arg()); ?>
<?php endif; ?>
@rom3r4
Copy link
Author

rom3r4 commented Sep 5, 2014

Redefinition of Search Results Snippet

File
/www/beta/sites/all/themes/ods_02/templatessearch-results--apachesolr-search.tpl.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment