-
Notifications
You must be signed in to change notification settings - Fork 423
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
Restored highlighting of title in search results #1973
Conversation
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.
@corrad82-4s & @nikunj59: Finally tested this today. This works, but only for Items and Publication Entities. If the search result is any other type of Entity (e.g. Journal, Project, OrgUnit or Person) or is a Community or Collection, then the title highlighting still does not occur. For example, try searching for a person's last name and the Person Entity won't have its title highlighted. Or, try searching for a term in a Journal title, and again highlighting will not occur for a matching Journal Entity. Or search on a Collection title, and you'll see the Collection's title will not be highlighted in the results.
So, this appears to only be a partial fix. I think the issue may be in the dsoTitle
(which seems to be used as the title of all objects in search results). By default that dsoTitle
just get the name of the object, but in this scenario maybe there's a way we can dynamically update it to use the firstMetadataValue('dc.title')
?? I admit though that I'm not sure how plausible that would be... I'm just pointing out that if you can fix dsoTitle
directly, then it may fix this issue for all objects.
…gUnit or Person) or is a Community or Collection
This PR has been updated with latest requested changes |
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.
@corrad82-4s and @nikunj59 : Re-tested this today. The behavior is better, but it's still not working for OrgUnits & Person Entities. I did notice those are the only two Entity Types where you switched away from using dsoTitle
. Could that be the reason these don't work?
I have verified though that Community/Collection/Project/Journal/Journal Issue/Journal Volume/Publication/Item all work. It's just down to the last two entities.
@tdonohue |
@nikunj59 : When searching Person Entities, I see the behavior in your first screenshot. If you look closely, the first person in your screenshot above should have hit highlighting. You searched on "test" and somehow it didn't highlight "Test, Test" (the first person in your list). If I similarly search on a Person's last name or first name, I cannot get hit highlighting to appear. I can verify that in the REST API response, the So, I can move this PR forward as-is. However, do you or @corrad82-4s plan to fix these backend bugs? Or should we create a new ticket to clarify that know issues with hit highlighting still occur for |
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.
👍 Changing my vote to a +1. This PR appears to have fixed the issues on the frontend.
However, Person
and OrgUnit
entities still do not show hit highlighting in the Name/Title field. This appears to be a backend issue though as the hitHighlights
in the REST response is always null
.
So, this fixes the frontend bug, but some known issues still remain.
@tdonohue : we are checking the backend issue. The cause seems to be a missing configuration. We are testing this updated configuration with this development. Once are tests will be run, we will update you through this PR |
@corrad82-4s @tdonohue |
@nikunj59 and @corrad82-4s : As the hit highlights are coming through on a different metadata field, that implies that this PR may need to not assume that the highlighted field is always Maybe this PR should be refactored to somehow use I'm going to leave this PR open until you have a chance to reanalyze whether there's a way to refactor to use |
@tdonohue |
@tdonohue |
Hi @tdonohue , |
@tdonohue |
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.
👍 Thanks @nikunj59 and @corrad82-4s ! This works well now, and I appreciate that the logic has all moved into dso-name.service.ts
alongside the getName()
method there.
I was able to verify that all object types & all entity types now show hit highlighting in the displayed title/name.
References
Description
Short summary of changes (1-2 sentences).
Title metadata value in search results list is filled using
firstMetadataValue
function, taking into account parts to be highlighted, if any.Instructions for Reviewers
Please add a more detailed description of the changes made by your PR. At a minimum, providing a bulleted list of changes in your PR is helpful to reviewers.
List of changes in this PR:
item-search-result-list-element-component
updated to usefirstMetadataValue
Include guidance for how to test or review your PR. This may include: steps to reproduce a bug, screenshots or description of a new feature, or reasons behind specific changes.
Checklist
This checklist provides a reminder of what we are going to look for when reviewing your PR. You need not complete this checklist prior to creating your PR (draft PRs are always welcome). If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!
yarn run lint
package.json
), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.