-
Notifications
You must be signed in to change notification settings - Fork 1
Federated search #222
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
base: master
Are you sure you want to change the base?
Federated search #222
Conversation
Trombach
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments
research-hub-web/src/app/components/search-page/search-page.component.html
Show resolved
Hide resolved
| <div>No More Results</div> | ||
| </div> | ||
| <mat-tab label="ResearchHub"> | ||
| <app-search-filter-bar |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The bar is currently not sticky.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Trombach may need your help on this one.
...ponents/search-page/intranet-search-results-list/intranet-search-results-list.component.scss
Outdated
Show resolved
Hide resolved
...rch-hub-web/src/app/components/search-page/intranet-search/intranet-search.component.spec.ts
Show resolved
Hide resolved
|
@Trombach have addressed most comments, just haven't managed to fix the sticky filter bar. Also added some (very) basic error handling for if there's any issue with fetching search results. The error handling could be improved with adding more informative message for the user, but for now I think it is enough. |
|
@Trombach also, if you have time could you please do a quick check of the interface in Safari? 🙏 |
Feature
Include results from the Staff Intranet in the ResearchHub search results UI
Description
The Intranet contains documents that overlap with the material the Research Hub provides. It is helpful to be able to include results from the Intranet in the Research Hub search, enabling users to navigate directly to these documents from the Research Hub search results page.
Intranet search results are accessed via a Swiftype API, within a collection called "Staff Intranet". This feature provides an update to the search page UI so logged-in users can choose to view the Intranet results, as well as the implementation of the backend API wrapper to access the Swiftype API securely. More information around the technical and security considerations of adding this feature can be found here.
Solution
Swiftype API Wrapper - Lambda function
A new endpoint has been added to the Hub-Search-Proxy lambda function which acts as a middleware between the UI and the Swiftype API. The purpose of this is to provide a secure way to access the Intranet search results, which must be behind SSO, as well as keeping the Swiftype API key in a secure location which will never be exposed to the frontend.
The new endpoint function is implemented in a separate handler file (uoasearch.js). The endpoint path is /uoasearch, which is configured in the serverless.yml, along with an API Gateway Authorizer to enable Cognito user pool authorization of requests to the endpoint. Requests must contain a valid auth token or they will be blocked by API Gateway. Requests are authorized by checking the user is in the valid access group to be able to view Staff Intranet data.
Search UI Changes
A tabbed interface has been added to the search results page using Angular Material Tabs component. ResearchHub results are shown in the default tab, and Staff Intranet results are shown (if the user is logged in) in a second tab, as a separate list. Results are only returned when a search query is present. Search filters are not applied on the Intranet results.
New components/services:
Cloudfront Function change
Screenshots
Before
After
Staff Intranet tab:

Testing
research-hub-web
IntranetSearchComponent:
IntranetSearchResultsListComponent:
IntranetSearchService
hub-search-proxy
Have the changes been checked in the following browsers?