Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlougheed committed Dec 12, 2024
1 parent 67d84e3 commit 0d6cdd0
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions bento_reference_service/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,12 +369,8 @@ def _q_param(pv: str | int) -> str:
return f"${len(q_params) + 3}" # plus 3: g_id, offset, limit at start

if q:
if q_fzy:
q_op = "%"
query_param = _q_param(f"%{q}%")
else:
q_op = "~"
query_param = _q_param(q)
query_param = _q_param(q)
q_op = "%" if q_fzy else "~"
gf_where_items.append(
f"""
gf.feature_id IN (
Expand All @@ -401,9 +397,8 @@ def _q_param(pv: str | int) -> str:
if name:
param = _q_param(name)
if name_fzy:
param_fzy = _q_param(f"%{name}%")
gf_select_items.append(f"similarity(gf.feature_name, {param}) gf_fn_sml")
gf_where_items.append(f"gf.feature_name % {param_fzy}")
gf_where_items.append(f"gf.feature_name % {param}")
gf_order_items.append("gf_fn_sml DESC")
else:
gf_where_items.append(f"gf.feature_name = {param}")
Expand Down

0 comments on commit 0d6cdd0

Please sign in to comment.