Skip to content

Commit

Permalink
FIX Update getSearchResults for extensible-search
Browse files Browse the repository at this point in the history
extensible-search API updated the expected result
variable type
  • Loading branch information
Marcus Nyeholt committed Mar 27, 2015
1 parent b0ad627 commit 682d1e4
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions code/extensions/SolrSearch.php
Expand Up @@ -15,9 +15,9 @@
if(class_exists('ExtensibleSearchPage')) {

class SolrSearch extends DataExtension {

const RESULTS_ACTION = 'results';

// Define the additional DB fields that are supported by solr search customisation.

public static $support = array(
'QueryType' => 1,
'SearchType' => 1,
Expand Down Expand Up @@ -390,8 +390,8 @@ public function currentFacets($term=null) {
}
$sq = $me->SearchQuery();
$sep = strlen($sq) ? '&' : '';
$facetTerm->SearchLink = $me->Link('results') . '?' . $sq .$sep. SolrSearch::$filter_param . "[$term][]=$facetTerm->Query";
$facetTerm->QuotedSearchLink = $me->Link('results') . '?' . $sq .$sep. SolrSearch::$filter_param . "[$term][]="$facetTerm->Query"";
$facetTerm->SearchLink = $me->Link(self::RESULTS_ACTION) . '?' . $sq .$sep. SolrSearch::$filter_param . "[$term][]=$facetTerm->Query";
$facetTerm->QuotedSearchLink = $me->Link(self::RESULTS_ACTION) . '?' . $sq .$sep. SolrSearch::$filter_param . "[$term][]="$facetTerm->Query"";
$result[] = new ArrayData($facetTerm);
}
return $result;
Expand Down Expand Up @@ -461,7 +461,7 @@ public function FacetCrumbs() {
$item = new stdClass();
$item->Name = $v;
$paramName = urlencode(SolrSearch::$filter_param . '[' . $facetName . '][' . $i . ']') .'='. urlencode($item->Name);
$item->RemoveLink = $this->owner->Link('results') . '?' . str_replace($paramName, '', $queryString);
$item->RemoveLink = $this->owner->Link(self::RESULTS_ACTION) . '?' . str_replace($paramName, '', $queryString);
$parts[] = new ArrayData($item);
}
}
Expand Down Expand Up @@ -501,6 +501,7 @@ function getSearchResults($data = null, $form = null){
'ResultData' => ArrayData::create($resultData),
'TimeTaken' => $elapsed
);

return $data;
}

Expand Down

0 comments on commit 682d1e4

Please sign in to comment.