Skip to content

Conversation

@toph-allen
Copy link
Collaborator

@toph-allen toph-allen commented Sep 23, 2025

Intent

Implement a first pass at content search.

Partially addresses #272

Approach

  • A basic function to call the content search API, just passing in the query string directly.
  • Just returns the raw server response currently.
  • Does not wrap pagination; provides the pagination parameters as function arguments. This may be addressed in a future PR.

Checklist

  • Does this change update NEWS.md (referencing the connected issue if necessary)?
  • Does this change need documentation? Have you run devtools::document()?

@toph-allen toph-allen linked an issue Sep 23, 2025 that may be closed by this pull request
@toph-allen
Copy link
Collaborator Author

Over time, we've moved away from splitting implementations between user-facing functions and endpoint methods on the Connect class.

But connectapi's implementation of offset pagination in page_offset() assumes that the function it's iterating over abstracts the endpoint in a specific way — assumes it can pass in page_number as an argument, and that the function it's calling will handle converting it to a query param before calling GET.

We don't want the user-facing function to have a page_number parameter — we want it to handle pagination and just return all the results.

For now, I'm considering one of a few approaches:

  1. Follow the old pattern — use a method on the client object for now — continue to follow that pattern for this paginated endpoint, and worry about untangling that abstraction later if possible.
  2. Put the inner method into a function that isn't a method on the client, still use the current page_offset() implementation. I don't know that this is an improvement, as it adds yet another pattern in the package.
  3. Come up with a lightweight way to iterate over the paginated endpoint within this function, to keep it completely separate from the old way.

@jonkeane @nealrichardson Interested to hear if y'all have a take on this.

@toph-allen toph-allen changed the title feat: initial private implementation of content search [draft] feat: simple function to wrap the GET v1/search/content endpoint Sep 29, 2025
@toph-allen toph-allen changed the title feat: simple function to wrap the GET v1/search/content endpoint feat: simple function to wrap GET v1/search/content Sep 29, 2025
@toph-allen toph-allen marked this pull request as ready for review September 29, 2025 21:27
@toph-allen toph-allen merged commit 365b2f0 into main Sep 30, 2025
10 of 21 checks passed
@toph-allen toph-allen deleted the toph/content-search-initial branch September 30, 2025 15:55
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.

Support content search query

4 participants