Skip to content

Add --search-type flag for semantic and hybrid issue search - #14006

Draft
michaeljacholke wants to merge 1 commit into
cli:trunkfrom
michaeljacholke:mj/semantic-search-issues
Draft

Add --search-type flag for semantic and hybrid issue search#14006
michaeljacholke wants to merge 1 commit into
cli:trunkfrom
michaeljacholke:mj/semantic-search-issues

Conversation

@michaeljacholke

Copy link
Copy Markdown

Adds a --search-type <lexical|semantic|hybrid> flag to gh search issues, defaulting to lexical so existing behavior is unchanged. When set to semantic or hybrid, the command sends the REST search_type query parameter.

Behavior

  • Semantic/hybrid are scoped to issues, so --include-prs cannot be combined with them, --sort / --order are rejected (results are relevance-ranked), and --web is rejected (the web search UI cannot carry search_type).
  • Unknown values are rejected client-side, since the API silently ignores them.
  • Support is feature-detected via the existing SearchType enum introspection (ISSUE_SEMANTIC / ISSUE_HYBRID), present on github.com and ghe.com, absent on single-tenant GHES, where the command fails with a clear "not supported on this host" error.
  • Semantic/hybrid use a separate, smaller rate-limit bucket, so fetching is bounded to a single page.

Testing

  • Unit tests cover query encoding, the searcher request (param present for semantic/hybrid, absent for lexical, single-page bound, and the unsupported-host error), feature detection, and flag validation.
  • Manually verified on github.com that --search-type semantic|hybrid sends the parameter and that no flag sends none.

Notes

  • search_type is independent of advanced_search=true.
  • Semantic ranking applies to keyword queries, quoted exact phrase queries are handled as lexical by the backend.

@github-actions github-actions Bot added external pull request originating outside of the CLI core team needs-triage needs to be reviewed labels Jul 29, 2026
@github-actions github-actions Bot removed the needs-triage needs to be reviewed label Jul 30, 2026
@babakks
babakks self-requested a review July 30, 2026 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external pull request originating outside of the CLI core team ready-for-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants