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

Find-moj-data-45/search-highlighting #78

Merged
merged 13 commits into from
Feb 22, 2024

Conversation

murdo-moj
Copy link
Contributor

@murdo-moj murdo-moj commented Feb 19, 2024

  • Add a matched fields entry to search results with readable names
  • Apply bold highlighting for search terms on the description and search summary fields
  • The search summary field isn't actually searched by datahub, it's more of a patch until we figure out how we want to handle long descriptions
  • Should URN/ID even be included in matched fields? Users will not care about it's URN or ID most likely.

templates/details.html Outdated Show resolved Hide resolved
@MatMoore
Copy link
Contributor

I agree we can ignore matching on URN and ID

home/service/search.py Outdated Show resolved Hide resolved
home/service/search.py Outdated Show resolved Hide resolved
home/service/search.py Outdated Show resolved Hide resolved
home/service/search.py Outdated Show resolved Hide resolved
@murdo-moj
Copy link
Contributor Author

murdo-moj commented Feb 21, 2024

I added back ID and URN, as otherwise some search results had blank match reasons. I've also displayed a clipped search description instead of a search summary on the search page. Pre-existing markdown will likely cause some weird rendering on the descriptions, but I couldn't think of a nice way around it other than restricting inputs for the descriptions.

I've tested the highlighted descriptions with a screenreader; it doesn't pick up the bolding. Jeremy points out that this isn't that important as highlighting is for visual acuity rather than screenreaders.

@murdo-moj murdo-moj merged commit d4871e8 into main Feb 22, 2024
2 checks passed
@murdo-moj murdo-moj deleted the find-moj-data-45/search-highlighting branch February 22, 2024 09:23
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