lsc hace 8 meses
padre
commit
b2f9cc02c4
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      pbl.js

+ 1 - 1
pbl.js

@@ -57,7 +57,7 @@ async function findMatchingContents(discipline, content) {
         const query = `
             SELECT id, content,
                    1 - (content_vector <#> $1::vector) AS contentSimilarity
-            FROM (select id, content, content_vector from knowledgefiles as a where top_dir_id in (select id from directory_files where folder_name = ANY(string_to_array($2, ',')))) as a
+            FROM (select id, content, content_vector from knowledgefiles as a where top_dir_id in (select id from directory_files where $2 = '' or folder_name = ANY(string_to_array($2, ',')))) as a
             ORDER BY contentSimilarity DESC
             LIMIT 5;
         `;