Describe the bug
Version: DSpace CRIS 2025.02.00
Having a relation defined in discovery.xml including a sort configuration, the Solr
query fails and no results are provided.
This happens because of the different Solr field types that are not considered in the code. E.g., for "date" fields, a fieldname with "_dt" added has to be used; fields with "_dt" are single-valued fields that can be sorted. Configuring a sort field "dc.date.issued" results in an invalid sort field.
To Reproduce
Steps to reproduce the behavior:
- In
discovery.xml in bean "relationAuthorResearchOutputsConfiguration" in the "searchSortConfiguration" set the defaultSortField to "sortDateIssuedDesc", add this sortfield also to the list of sortFields
- Then load a researcher profile with the publications. There will not be any results; the layout of the page seems to be of DSpace Core.
Expected behavior
The researcher page is loaded including the list of publications the researcher has authored. The publications are ordered by "dc.date.issued" in a descending order.
Solution
In DiscoveryConfigurationUtilsService#findByRelation setting the sortfield for the DiscoveryQuery needs to call SolrServiceImpl#toSortFieldIndex to get the correct field name.
Describe the bug
Version: DSpace CRIS 2025.02.00
Having a relation defined in discovery.xml including a sort configuration, the Solr
query fails and no results are provided.
This happens because of the different Solr field types that are not considered in the code. E.g., for "date" fields, a fieldname with "_dt" added has to be used; fields with "_dt" are single-valued fields that can be sorted. Configuring a sort field "dc.date.issued" results in an invalid sort field.
To Reproduce
Steps to reproduce the behavior:
discovery.xmlin bean "relationAuthorResearchOutputsConfiguration" in the "searchSortConfiguration" set the defaultSortField to "sortDateIssuedDesc", add this sortfield also to the list of sortFieldsExpected behavior
The researcher page is loaded including the list of publications the researcher has authored. The publications are ordered by "dc.date.issued" in a descending order.
Solution
In
DiscoveryConfigurationUtilsService#findByRelationsetting the sortfield for the DiscoveryQuery needs to callSolrServiceImpl#toSortFieldIndexto get the correct field name.