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
WHERE similarity > {settings.EMBEDDING_TERMINOLOGY_SIMILARITY} AND oid = :oid
393
+
AND (specific_ds = false OR specific_ds IS NULL)
394
+
ORDER BY similarity DESC
395
+
LIMIT {settings.EMBEDDING_TERMINOLOGY_TOP_COUNT}
396
+
"""
397
+
398
+
embedding_sql_with_datasource=f"""
399
+
SELECT id, pid, word, similarity
400
+
FROM
401
+
(SELECT id, pid, word, oid, specific_ds, datasource_ids,
402
+
( 1 - (embedding <=> :embedding_array) ) AS similarity
403
+
FROM terminology AS child
404
+
) TEMP
405
+
WHERE similarity > {settings.EMBEDDING_TERMINOLOGY_SIMILARITY} AND oid = :oid
393
406
AND (
394
-
(:datasource IS NULL AND (specific_ds = false OR specific_ds IS NULL))
395
-
OR
396
-
(: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))))
407
+
(specific_ds = false OR specific_ds IS NULL)
408
+
OR
409
+
(specific_ds = true AND datasource_ids IS NOT NULL AND datasource_ids @> jsonb_build_array(:datasource))
0 commit comments