From 6a4bdaebf1cc28d118d943dbaff634dca4a52cef Mon Sep 17 00:00:00 2001
From: Eunhak Lee <lee@enak.kr>
Date: Sat, 7 Dec 2024 23:19:32 +0900
Subject: [PATCH] =?UTF-8?q?hotfix:=20similarity=20threshold=20=EB=A5=BC=20?=
 =?UTF-8?q?=ED=82=A4=EC=9B=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

너무 많은 경우에 자신의 부품이 아닌데도 매칭되는 경우가 생김
---
 push_to_db.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/push_to_db.py b/push_to_db.py
index 8435b84..c7b19b1 100644
--- a/push_to_db.py
+++ b/push_to_db.py
@@ -18,7 +18,7 @@ from datetime import datetime, timedelta
 def check_similarity(_conn, name, part_type):
     _cursor = _conn.cursor()
     where_clause = "WHERE type = '{}'".format(part_type.upper()) if part_type else ""
-    _auto_threshold = 1.0 if part_type in ('RAM', 'SSD', 'HDD',) else 0.13
+    _auto_threshold = 1.0 if part_type in ('RAM', 'SSD', 'HDD',) else 0.5
 
     _cursor.execute("WITH comp AS (SELECT id, name, similarity(name::text, %s::text) as sim FROM parts " + where_clause + ") SELECT * FROM comp WHERE sim >=%s ORDER BY sim DESC LIMIT 5;", (name, _auto_threshold,))
 
-- 
GitLab