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
(SELECT id, pid, word, oid, specific_ds, datasource_ids,
371
371
( 1 - (embedding <=> :embedding_array) ) AS similarity
372
372
FROM terminology AS child
373
373
) TEMP
374
-
WHERE similarity > {settings.EMBEDDING_TERMINOLOGY_SIMILARITY} and oid = :oid
374
+
WHERE similarity > {settings.EMBEDDING_TERMINOLOGY_SIMILARITY} AND oid = :oid
375
+
AND (
376
+
(:datasource IS NULL AND (specific_ds = false OR specific_ds IS NULL))
377
+
OR
378
+
(:datasource IS NOT NULL AND ((specific_ds = false OR specific_ds IS NULL) OR (specific_ds = true AND datasource_ids IS NOT NULL AND datasource_ids @> jsonb_build_array(:datasource))))
0 commit comments