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 SearchQuery $query
|
||||||
* @param integer $offset
|
* @param integer $offset
|
||||||
* @param integer $limit
|
* @param integer $limit
|
||||||
|
* @param Array $params Extra request parameters passed through to Solr
|
||||||
* @return ArrayData Map with the following keys:
|
* @return ArrayData Map with the following keys:
|
||||||
* - 'Matches': ArrayList of the matched object instances
|
* - '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();
|
$service = $this->getService();
|
||||||
|
|
||||||
SearchVariant::with(count($query->classes) == 1 ? $query->classes[0]['class'] : null)->call('alterQuery', $query, $this);
|
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 = $query->limit;
|
||||||
if ($limit == -1) $limit = SearchQuery::$default_page_size;
|
if ($limit == -1) $limit = SearchQuery::$default_page_size;
|
||||||
|
|
||||||
|
$params = array_merge($params, array('fq' => implode(' ', $fq)));
|
||||||
|
|
||||||
$res = $service->search(
|
$res = $service->search(
|
||||||
$q ? implode(' ', $q) : '*:*',
|
$q ? implode(' ', $q) : '*:*',
|
||||||
$offset,
|
$offset,
|
||||||
$limit,
|
$limit,
|
||||||
array('fq' => implode(' ', $fq)),
|
$params,
|
||||||
Apache_Solr_Service::METHOD_POST
|
Apache_Solr_Service::METHOD_POST
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue