Skip to content

fix: deal name search param + document verified filter formats - #21

Merged
jschfflr merged 1 commit into
mainfrom
fix/filter-formats-and-deal-param
Jul 10, 2026
Merged

fix: deal name search param + document verified filter formats#21
jschfflr merged 1 commit into
mainfrom
fix/filter-formats-and-deal-param

Conversation

@jschfflr

Copy link
Copy Markdown
Contributor

Follow-up from an empirical audit that exercised every search filter live (baseline vs filtered total) to confirm each one actually reduces results and to capture its accepted format.

Bug fixed

Deal name search never worked. search_deals/deals search --query send q_keywords, which Apollo silently ignores on /opportunities/search (a nonsense keyword still returned all 284 deals). The working param is q_opportunity_name ("NORRIQ" → 1). DEAL_SEARCH_FILTERS now allows q_opportunity_name and rejects q_keywords. (A companion CLI PR maps deals search --queryq_opportunity_name.)

Docs — accepted formats now in the docstrings

Empirically verified and documented per search_*:

  • person_seniorities — lowercase enums (owner, vp, c_suite, …); uppercase/free-text → 0 rows.
  • organization_num_employees_ranges"min,max" comma ("1-10" dash is silently ignored).
  • person_locations/organization_locations — country name, 2-letter code ("US""United States"), or "City, State, Country".
  • revenue_range/organization_num_jobs_range{"min":N,"max":N}; contact_email_status values; canonical linkedin_url; sort fields.

Also added a filter-formats note to CLAUDE.md.

Testing

  • +1 test locking in the deal param; ruff ✅ · pyright ✅ · 197 tests ✅.
  • Every documented format was live-verified (each filter measurably narrows the result count).

No version bump (release PR will handle it).

🤖 Generated with Claude Code

- Deal name search: q_keywords is silently ignored by /opportunities/search;
  q_opportunity_name actually filters. DEAL_SEARCH_FILTERS now allows
  q_opportunity_name (and rejects q_keywords). +test.
- Enriched search_contacts/accounts/deals/people docstrings with the
  empirically-verified accepted formats (seniority enums, 'min,max' employee
  ranges, location formats, dict ranges, email-status values, canonical
  linkedin_url, deal name param, sort fields).
- Added a Search-filter formats note to CLAUDE.md quirks.

All formats were live-verified (each filter measurably reduces results).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@peqy

peqy Bot commented Jul 10, 2026

Copy link
Copy Markdown

Looks good. Switching deal name search to q_opportunity_name (and failing loudly on q_keywords) + locking it in with a test should prevent silent unfiltered results; the expanded docstrings/CLAUDE.md notes are clear. Ship it.

@jschfflr
jschfflr merged commit 72d52cd into main Jul 10, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant