From a7d83bc582bf2f98aa49dbf89d2577236cf27061 Mon Sep 17 00:00:00 2001 From: mlnkng Date: Mon, 27 May 2024 05:43:22 -0700 Subject: [PATCH] Use DSL query format for search. --- plugins/arSolrPlugin/lib/arSolrPlugin.class.php | 2 +- plugins/arSolrPlugin/lib/arSolrQuery.class.php | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/plugins/arSolrPlugin/lib/arSolrPlugin.class.php b/plugins/arSolrPlugin/lib/arSolrPlugin.class.php index b676f3cb12..4bb1bde3da 100644 --- a/plugins/arSolrPlugin/lib/arSolrPlugin.class.php +++ b/plugins/arSolrPlugin/lib/arSolrPlugin.class.php @@ -276,7 +276,7 @@ public function getSolrCollection() public function search($query) { - $url = $this->getSolrUrl().'/solr/'.$this->getSolrCollection().'/select'; + $url = $this->getSolrUrl().'/solr/'.$this->getSolrCollection().'/query'; $response = arSolrPlugin::makeHttpRequest($url, 'POST', json_encode($query->getQueryParams())); return $response->response->docs; diff --git a/plugins/arSolrPlugin/lib/arSolrQuery.class.php b/plugins/arSolrPlugin/lib/arSolrQuery.class.php index 36d61f46e2..b8ea843b54 100644 --- a/plugins/arSolrPlugin/lib/arSolrQuery.class.php +++ b/plugins/arSolrPlugin/lib/arSolrQuery.class.php @@ -140,14 +140,15 @@ public function getQueryParams() public function generateQueryParams() { $this->query = [ - 'params' => [ - 'start' => $this->offset, - 'rows' => $this->size, - 'q.op' => $this->operator, - 'defType' => 'edismax', - 'stopwords' => 'true', - 'q' => $this->searchQuery, - 'pf' => implode(' ', $this->fields), + 'query' => [ + 'edismax' => [ + 'start' => $this->offset, + 'rows' => $this->size, + 'q.op' => $this->operator, + 'stopwords' => 'true', + 'query' => $this->searchQuery, + 'qf' => implode(' ', $this->fields), + ], ], ]; }