Skip to content

Commit

Permalink
Outlet filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Mar 26, 2020
1 parent 6fbae44 commit 82288aa
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Solr/SolrIndex.php
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,12 @@ public function search(SearchQuery $query, $offset = -1, $limit = -1, $params =
foreach ($res->response->docs as $doc) {
$result = DataObject::get_by_id($doc->ClassName, $doc->ID);
if ($result) {
// Filter out any results previously added to the solr index that have ShowInSearch == 0
// This may also include any results where getShowInSearch() == false
if (isset($result->ShowInSearch) && !$result->ShowInSearch) {
continue;
}

$results->push($result);

// Add highlighting (optional)
Expand Down

0 comments on commit 82288aa

Please sign in to comment.