Skip to content

Loading a relation fails with a configured sort field #547

@kskaiser

Description

@kskaiser

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:

  1. In discovery.xml in bean "relationAuthorResearchOutputsConfiguration" in the "searchSortConfiguration" set the defaultSortField to "sortDateIssuedDesc", add this sortfield also to the list of sortFields
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions