Skip to content

Commit

Permalink
feat: Create overrideable createSearchResultsFromResponse method fo…
Browse files Browse the repository at this point in the history
…r any AbstractSearchHandler extending class
  • Loading branch information
ambroisemaupate committed Mar 14, 2023
1 parent a044446 commit b23b92f
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ public function searchWithHighlight(
$args["fq"][] = "document_type_s:" . $this->getDocumentType();
$args = array_merge($this->getHighlightingOptions($args), $args);
$response = $this->nativeSearch($q, $args, $rows, $searchTags, $proximity, $page);
return $this->createSearchResultsFromResponse($response);
}

protected function createSearchResultsFromResponse(?array $response): SolrSearchResults
{
return new SolrSearchResults(null !== $response ? $response : [], $this->em);
}

Expand Down Expand Up @@ -204,7 +209,7 @@ public function search(
$args = array_merge($tmp, $args);

$response = $this->nativeSearch($q, $args, $rows, $searchTags, $proximity, $page);
return new SolrSearchResults(null !== $response ? $response : [], $this->em);
return $this->createSearchResultsFromResponse($response);
}

/**
Expand Down

0 comments on commit b23b92f

Please sign in to comment.