Skip to content
Snippets Groups Projects
Commit 6a4bdaeb authored by Eunhak Lee's avatar Eunhak Lee
Browse files

hotfix: similarity threshold 를 키움

너무 많은 경우에 자신의 부품이 아닌데도 매칭되는 경우가 생김
parent 2c32e38f
No related branches found
No related tags found
No related merge requests found
Pipeline #10789 passed
......@@ -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,))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment