Skip to content

Commit

Permalink
SmartSearch::getInitialFacets(): fix weights processing
Browse files Browse the repository at this point in the history
  • Loading branch information
zozlak committed Apr 11, 2024
1 parent 759c8f2 commit 71f1862
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/acdhOeaw/arche/lib/SmartSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -878,8 +878,8 @@ public function getInitialFacets(string $prefLang, string $cacheFile = '',
$weightQuery = '';
$weightJoin = '';
$weightOrder = '';
if (is_object($facet->weights ?? null)) {
$tmpQuery = $this->getWeightsWith($facet->weights, 'weight', 'bigint');
if (is_array($facet->weights ?? null)) {
$tmpQuery = $this->getWeightsWith($facet->weights, 'weight', $facet->type === 'object' ? 'bigint' : 'text');
$weightQuery = "WITH w " . $tmpQuery->query;
$weightJoin = ($facet->type === 'object' ? 'LEFT ' : '') . "JOIN w USING (value)";
$weightOrder = "weight DESC NULLS LAST,";
Expand Down

0 comments on commit 71f1862

Please sign in to comment.