Add option to highlight search result matches#2331
Open
danloveg wants to merge 14 commits intoartefactual:qa/2.xfrom
Open
Add option to highlight search result matches#2331danloveg wants to merge 14 commits intoartefactual:qa/2.xfrom
danloveg wants to merge 14 commits intoartefactual:qa/2.xfrom
Conversation
Contributor
|
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:
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.