You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 574079f
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: apps/sim/lib/knowledge/search/queries.ts
+3-4Lines changed: 3 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -2175,14 +2175,13 @@ export async function executeKeywordSearch(params: KeywordSearchParams): Promise
2175
2175
? sql`EXISTS (SELECT 1 FROM ${document} WHERE ${and(sql`${document.id} = ranked_tin_chunks.document_id`,dateFilterCondition(params.filters))})`
2176
2176
: undefined,
2177
2177
/**
2178
-
* The row's mirrored source decides it once the fill is complete; until then a row the
2179
-
* fill has not reached carries no source, so its document is asked instead, as the
2180
-
* vector leg does.
2178
+
* A filled row's mirrored source decides it; a row the fill has not reached carries no
2179
+
* source, so only its document is asked, as the vector leg does.
2181
2180
*/
2182
2181
excludedSources.length
2183
2182
? tinFilled
2184
2183
? sql`(ranked_tin_chunks.connector_id IS NULL OR NOT (ranked_tin_chunks.connector_id = ANY(${textArrayLiteral([...excludedSources])})))`
2185
-
: sql`NOT EXISTS (SELECT 1 FROM ${document} WHERE ${document.id} = ranked_tin_chunks.document_id AND ${document.connectorId} = ANY(${textArrayLiteral([...excludedSources])}))`
2184
+
: sql`((ranked_tin_chunks.acl IS NOT NULL AND (ranked_tin_chunks.connector_id IS NULL OR NOT (ranked_tin_chunks.connector_id = ANY(${textArrayLiteral([...excludedSources])})))) OR (ranked_tin_chunks.acl IS NULL AND NOT EXISTS (SELECT 1 FROM ${document} WHERE ${document.id} = ranked_tin_chunks.document_id AND ${document.connectorId} = ANY(${textArrayLiteral([...excludedSources])}))))`
0 commit comments