nikeshn commited on
Commit
3867469
·
verified ·
1 Parent(s): cb99cc3

Update src/api/search.py

Browse files
Files changed (1) hide show
  1. src/api/search.py +3 -1
src/api/search.py CHANGED
@@ -92,7 +92,9 @@ def _boolean_to_primo_params(boolean_query: str) -> str:
92
  g = group.strip()
93
  if g.startswith('(') and g.endswith(')'):
94
  g = g[1:-1].strip()
95
- g = re.sub(r'["\']', '', g)
 
 
96
  g = re.sub(r'\s+OR\s+', ' OR ', g, flags=re.IGNORECASE).strip()
97
  if not g:
98
  continue
 
92
  g = group.strip()
93
  if g.startswith('(') and g.endswith(')'):
94
  g = g[1:-1].strip()
95
+ # FIX: do NOT strip quotes — keep "phrase" intact so PRIMO REST API
96
+ # performs exact phrase matching, matching what the browser link does.
97
+ # Removed: g = re.sub(r'["\']', '', g) ← was destroying phrase matching
98
  g = re.sub(r'\s+OR\s+', ' OR ', g, flags=re.IGNORECASE).strip()
99
  if not g:
100
  continue