diff --git a/app/src/Database.php b/app/src/Database.php index 9656e29..ebdc1fa 100644 --- a/app/src/Database.php +++ b/app/src/Database.php @@ -694,8 +694,9 @@ class Database $allFi = array_column($exec('SELECT name FROM finality_types ORDER BY name', []), 'name'); $fiOut = array_map(fn ($n) => ['value' => $n, 'matched' => in_array($n, $matchedFiIds, true)], $allFi); - // Keywords - [$w, $b] = $buildWhere('kw'); + // Keywords — many-to-many: use full intersection so that selecting + // a keyword filters the available set to only co-occurring keywords. + [$w, $b] = $buildWhere('__none__'); $matchedKw = array_column($exec( "SELECT DISTINCT tg.name $baseJoins JOIN thesis_tags tt ON tt.thesis_id = t.id