Skip to content

Commit

Permalink
Updated the builder to filter by hierarchy correctly.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Glasl committed May 21, 2014
1 parent e37b1e4 commit 94607b4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion code/model/SolrResultSet.php
Expand Up @@ -12,7 +12,7 @@ class SolrResultSet {
/**
* A list of solr field type suffixes to look for and swap out
*/
static $solr_attrs = array('txt', 'ms', 's', 't', 'i', 'dt', 'f', 'p');
static $solr_attrs = array('as', 'ms', 's', 't', 'i', 'dt', 'f', 'p');

/**
* The raw lucene query issued to solr
Expand Down
4 changes: 2 additions & 2 deletions code/pages/SolrSearchPage.php
Expand Up @@ -411,12 +411,12 @@ public function getQuery() {

if (count($types)) {
$sortBy = $this->solrSearchService->getSortFieldName($sortBy, $types);
$builder->andWith('ClassNameHierarchy_ms', $types);
$builder->addFilter('ClassNameHierarchy_ms', implode(' OR ', $types));
}

if ($this->SearchTrees()->count()) {
$parents = $this->SearchTrees()->column('ID');
$builder->andWith('ParentsHierarchy_ms', $parents);
$builder->addFilter('ParentsHierarchy_ms', implode(' OR ', $parents));
}

if (!$sortBy) {
Expand Down

0 comments on commit 94607b4

Please sign in to comment.