Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WEBDEV-7001 Build federated search "backend" #59

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

rebecca-shoptaw
Copy link
Contributor

@rebecca-shoptaw rebecca-shoptaw commented Sep 13, 2024

Adds a new search type (SearchType.FEDERATED) to the search service to fetch federated results from the new PPS endpoint. Intended to be used for search prototyping.

Current endpoint service names:

  • Metadata: not added to the endpoint output yet, see TODOs throughout
  • Full text: full_text
  • TV: tv_captions
  • Radio: radio_captions
  • Transcription: media_transcription

Accessing results:

  • response.pageElements.full_text.hits --> a full raw hits object with totals, returned count, and an array of hits
  • response.federatedResults.full_text --> an array of hits correctly formatted as TextHit, TVClipHit, etc.

Note:

  • Currently uses review app URL for in-progress endpoint, changes to the endpoint may require (hopefully minor) changes to the code

Copy link

PR Preview Action v1.4.7
🚀 Deployed preview to https://internetarchive.github.io/iaux-search-service/pr/pr-59/
on branch gh-pages at 2024-09-13 19:53 UTC

* Optional.
* Start time for TV hit.
*/
@Memoize() get start(): StringField | undefined {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the only prop that differs from full-text search! Replaces page_num.

for (const service of SEARCH_SERVICES) {
this.federatedResults
? (this.federatedResults[service] = [])
: (this.federatedResults = { [service]: [] });
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This probably could/should be split into sub-functions for clarity.

@rebecca-shoptaw rebecca-shoptaw changed the title Build federated search "backend" WEBDEV-7001 Build federated search "backend" Sep 13, 2024
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