dspace-angular
dspace-angular copied to clipboard
Search in sidebar/facet don't escape special characters
Describe the bug
The facet search, that uses the endpoint /server/api/discover/facets/{facetName}, in the search sidebar (expand filter in sidebar, start typing in search bar of that facet) doesn't escape special characters.
Additionally, the facets endpoint, /server/api/discover/facets/{facetName}?prefix search doesn't take into account capital letters. The search in de facets/filters sidebars has a workaround for capital letters since the value gets lowercased, but should probably addressed REST side.
To Reproduce
- Go to search
- Expand the sidebar filter and start typing search bar
- (see network tab) The search query gets sent to
/server/api/discover/facets/{facetName}?prefix={query}lowercased but not url escaped - See below for examples
Example Special characters
- subject?prefix=10=> Has result "10% kobalt dengan pengacuanan suntikan serbuk mikro"
- subject?prefix=10% => No results, so shows all subjects
- Escaped: subject?prefix=10%25 => Has result "10% kobalt dengan pengacuanan suntikan serbuk mikro"
- In UI this is an issue, because requests done do not have escaped value in prefix
Example capital letters:
- author?prefix=a => results, all starting with A or a
- author?prefix=A => no results, despite there being authors starting with A
- In UI this is not an issue, because the requests done have lowercased value in prefix
Example comma (not an issue): author?prefix=asnani,%20m => result "Asnani, Minakshi"
Expected behavior The search in the sidebar for additional facet values should be url escaped so that special characters can be used.
Related work Capital letter REST issue here: https://github.com/DSpace/DSpace/issues/8516
Addressing this issue would take 2 hours to address and test.
Thanks for reporting this @MarieVerdonck . I'll pull this over to the 7.5 board, add the estimate and assign back to you to work on (assuming you / your team is interested... if not, we can unassign & wait for a different volunteer)