花花
commited on
Commit
·
3a67714
1
Parent(s):
a71ca10
fix: PostgreSQL database, error:subquery in FROM must have an alias
Browse files
lightrag/kg/postgres_impl.py
CHANGED
|
@@ -1819,10 +1819,10 @@ SQL_TEMPLATES = {
|
|
| 1819 |
FROM LIGHTRAG_VDB_ENTITY e
|
| 1820 |
JOIN relevant_chunks c ON c.chunk_id = ANY(e.chunk_ids)
|
| 1821 |
WHERE e.workspace=$1
|
| 1822 |
-
)
|
| 1823 |
-
|
| 1824 |
-
|
| 1825 |
-
|
| 1826 |
""",
|
| 1827 |
"chunks": """
|
| 1828 |
WITH relevant_chunks AS (
|
|
|
|
| 1819 |
FROM LIGHTRAG_VDB_ENTITY e
|
| 1820 |
JOIN relevant_chunks c ON c.chunk_id = ANY(e.chunk_ids)
|
| 1821 |
WHERE e.workspace=$1
|
| 1822 |
+
) as chunk_distances
|
| 1823 |
+
WHERE distance>$2
|
| 1824 |
+
ORDER BY distance DESC
|
| 1825 |
+
LIMIT $3
|
| 1826 |
""",
|
| 1827 |
"chunks": """
|
| 1828 |
WITH relevant_chunks AS (
|