mirror of
https://github.com/silverstripe/silverstripe-fulltextsearch
synced 2024-10-22 14:05:29 +02:00
Merge branch 'pull/custom-query-params' of github.com:silverstripe-big-o/silverstripe-fulltextsearch into silverstripe-big-o-pull/custom-query-params
This commit is contained in:
commit
756e307562
@ -222,10 +222,11 @@ abstract class SolrIndex extends SearchIndex {
|
||||
* @param SearchQuery $query
|
||||
* @param integer $offset
|
||||
* @param integer $limit
|
||||
* @param Array $params Extra request parameters passed through to Solr
|
||||
* @return ArrayData Map with the following keys:
|
||||
* - 'Matches': ArrayList of the matched object instances
|
||||
*/
|
||||
public function search(SearchQuery $query, $offset = -1, $limit = -1) {
|
||||
public function search(SearchQuery $query, $offset = -1, $limit = -1, $params = array()) {
|
||||
$service = $this->getService();
|
||||
|
||||
SearchVariant::with(count($query->classes) == 1 ? $query->classes[0]['class'] : null)->call('alterQuery', $query, $this);
|
||||
@ -327,11 +328,13 @@ abstract class SolrIndex extends SearchIndex {
|
||||
if ($limit == -1) $limit = $query->limit;
|
||||
if ($limit == -1) $limit = SearchQuery::$default_page_size;
|
||||
|
||||
$params = array_merge($params, array('fq' => implode(' ', $fq)));
|
||||
|
||||
$res = $service->search(
|
||||
$q ? implode(' ', $q) : '*:*',
|
||||
$offset,
|
||||
$limit,
|
||||
array('fq' => implode(' ', $fq)),
|
||||
$params,
|
||||
Apache_Solr_Service::METHOD_POST
|
||||
);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user