Skip to content

[DISCO-3583] Add client for Merino Suggest#7314

Merged
misaniwere merged 2 commits intomainfrom
DISCO-3583
Apr 14, 2026
Merged

[DISCO-3583] Add client for Merino Suggest#7314
misaniwere merged 2 commits intomainfrom
DISCO-3583

Conversation

@misaniwere
Copy link
Copy Markdown
Contributor

@misaniwere misaniwere commented Apr 8, 2026

  • [DISCO-3583]
  • This PR adds a new suggest module to the merino crate with a SuggestClient that calls the Merino /api/v1/suggest endpoint and is exposed to iOS and Android through UniFFI
  • Also added a suggest subcommand to merino-cli for local testing.

Changes

  • SuggestClient: the public UniFFI object exposed to iOS/Android. Takes a SuggestConfig (optional base host override) and exposes a get_suggestions(query, options) method that returns the raw JSON response body as a string.
  • SuggestOptions: a UniFFI record mapping all merino suggest query parameters (providers, source, country, region, city, client_variants, request_type, accept_language). All fields are optional and omitted fields are not sent.
  • uses viaduct's send_sync with an OHTTP channel ( "merino")

QA

  • Can be QA'd be running tests: cargo test -p merino suggest
  • Also locally hitting the endpoint using prod and ohttp: cargo run -p merino-cli -- suggest --query "apple"
  • Confirm curated recommendations command still works:
    cargo run --bin merino-cli -- recommendations --user-agent "my-cli/1.0" --json '{ "locale": "en", "region": "US", "count": 4, "topics": ["tech"], "feeds": ["sections"] }'

Pull Request checklist

  • Breaking changes: This PR follows our breaking change policy
    • This PR follows the breaking change policy:
      • This PR has no breaking API changes, or
  • Quality: This PR builds and tests run cleanly
    • Note:
      • For changes that need extra cross-platform testing, consider adding [ci full] to the PR title.
      • If this pull request includes a breaking change, consider cutting a new release after merging.
  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Changelog: This PR includes a changelog entry in CHANGELOG.md or an explanation of why it does not need one
    • Any breaking changes to Swift or Kotlin binding APIs are noted explicitly
  • Dependencies: This PR follows our dependency management guidelines
    • Any new dependencies are accompanied by a summary of the due diligence applied in selecting them.

@misaniwere misaniwere requested a review from a team April 8, 2026 20:17
@misaniwere misaniwere force-pushed the DISCO-3583 branch 5 times, most recently from 118ee34 to 5325eea Compare April 8, 2026 21:43
gruberb
gruberb previously approved these changes Apr 14, 2026
Copy link
Copy Markdown
Member

@gruberb gruberb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really good 🎉

Just a few nits.

Comment thread components/merino/src/suggest/http.rs
Comment thread components/merino/src/suggest/http.rs Outdated
Comment thread examples/merino-cli/src/main.rs
Comment thread components/merino/src/suggest/http.rs Outdated
@mergify mergify Bot dismissed gruberb’s stale review April 14, 2026 20:15

The pull request has been modified, dismissing previous reviews.

ncloudioj
ncloudioj previously approved these changes Apr 14, 2026
Copy link
Copy Markdown
Member

@ncloudioj ncloudioj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just two OHTTP URLs to be updated.

Comment thread examples/merino-cli/src/main.rs Outdated
Comment thread examples/merino-cli/src/main.rs Outdated
@mergify mergify Bot dismissed ncloudioj’s stale review April 14, 2026 20:31

The pull request has been modified, dismissing previous reviews.

@misaniwere misaniwere enabled auto-merge April 14, 2026 20:51
@misaniwere misaniwere added this pull request to the merge queue Apr 14, 2026
Merged via the queue into main with commit ed086e7 Apr 14, 2026
15 checks passed
@misaniwere misaniwere deleted the DISCO-3583 branch April 14, 2026 21:14
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.

3 participants