You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds an option to highlight search results for information objects. I've been working with researchers using AtoM recently and they mentioned that being able to see why certain descriptions are returned in the search results at a glance would be a useful feature. This PR adds subtle highlighting to search results to show what text matched the search query. If the title, scope and content, or creator is matched on, then those highlights are added inline to the existing rendered fields. If other fields that are not typically included in the search results are matched on, they are added in a new block. See here:
Elasticsearch already has this capability, it was just a matter of turning highlighting on and rendering its results. It returns matches wrapped in <mark></mark> tags.
Since administrators might not want this active, you can disable it in the settings. I've made it enabled by default.
I understand this feature probably won't make it for 2.11 but thought I'd open this pull request in case this would be a useful feature for others, as well.
Hi @danloveg , we'd been testing this feature out, and it looks great! We had a couple of minor things we noticed during testing that we wanted to flag:
Currently the contrast ratio for the highlight colour against the background colour is too low. I would recommend picking a darker/more saturated shade. You could use Web AIM's contrast checker to test a chosen colour and confirm that it meets the accessibility standards.
When a language is picked to narrow down search results, the language code itself shows up as a match. Not sure if this is something that's easy to fix since I haven't dived into this PR yet.
Hi @danloveg , we'd been testing this feature out, and it looks great! We had a couple of minor things we noticed during testing that we wanted to flag:
Currently the contrast ratio for the highlight colour against the background colour is too low. I would recommend picking a darker/more saturated shade. You could use Web AIM's contrast checker to test a chosen colour and confirm that it meets the accessibility standards.
When a language is picked to narrow down search results, the language code itself shows up as a match. Not sure if this is something that's easy to fix since I haven't dived into this PR yet.
Thanks for taking a look! I've upped the contrast, there's no warning about contrast issues in my browser's accessibility tab any more. This is what I came up with for the new styling.
And regarding the language, thanks for flagging that. I am ignoring i18n.languages as a highlighted field which fixes the language being shown in the highlighting, and there was some extra culture checking I needed to do to handle multi-lingual descriptions. It appears to be working correctly now.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CommunityPull requests that have been contributed from community members outside Artefactual
4 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds an option to highlight search results for information objects. I've been working with researchers using AtoM recently and they mentioned that being able to see why certain descriptions are returned in the search results at a glance would be a useful feature. This PR adds subtle highlighting to search results to show what text matched the search query. If the title, scope and content, or creator is matched on, then those highlights are added inline to the existing rendered fields. If other fields that are not typically included in the search results are matched on, they are added in a new block. See here:
Elasticsearch already has this capability, it was just a matter of turning highlighting on and rendering its results. It returns matches wrapped in
<mark></mark>tags.Since administrators might not want this active, you can disable it in the settings. I've made it enabled by default.
I understand this feature probably won't make it for 2.11 but thought I'd open this pull request in case this would be a useful feature for others, as well.