Skip to content

Commit

Permalink
Add sorting for Solr
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-schranz committed Feb 1, 2023
1 parent 1382fcd commit cf32175
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions packages/seal-solr-adapter/SolrConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ public function search(Search $search): Result
}

if ($queryText !== null) {
$query->setFields($index->searchableFields);
$query->setQuery($helper->escapePhrase($queryText));
}

Expand All @@ -143,17 +144,9 @@ public function search(Search $search): Result
$query->setRows($search->limit);
}

/*
$searchParams = [];
if (\count($filters) !== 0) {
$searchParams = ['filter' => \implode(' AND ', $filters)];
}
TODO
foreach ($search->sortBys as $field => $direction) {
$searchParams['sort'][] = $field . ':' . $direction;
$query->addSort($field, $direction);
}
*/

$result = $this->client->select($query);

Expand Down

0 comments on commit cf32175

Please sign in to comment.