Skip to content

Commit

Permalink
Use DSL query format for search.
Browse files Browse the repository at this point in the history
  • Loading branch information
melaniekung committed May 27, 2024
1 parent a1692e9 commit a7d83bc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion plugins/arSolrPlugin/lib/arSolrPlugin.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
17 changes: 9 additions & 8 deletions plugins/arSolrPlugin/lib/arSolrQuery.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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),
],
],
];
}
Expand Down

0 comments on commit a7d83bc

Please sign in to comment.