Search code examples
metadatadspace

DSpace - XMLUI Discovery - Sorting items with a combination of metadata


I would need to sort the items displayed on the XMLUI discovery page using a combination of metadata, because the type of ordering required (specifically for size) uses a different metadata for media type of reference (see images, audio, video ...) .

Wanting to act, as per documentation, on the file "discovery.xml" but specifying a bean of this type:

<bean id="sortSize" class="org.dspace.discovery.configuration.DiscoverySortFieldConfiguration">
   <property name="metadataFields"/>
      <list>
         <value>METADATA_NAME_1</value>
         <value>METADATA_NAME_2</value>
         ...
      </list>
   </property>
</bean>

Indexing is not successful. This is because it is only possible to indicate a sort bean of this type:

<bean id="sortSize" class="org.dspace.discovery.configuration.DiscoverySortFieldConfiguration">
   <property name="metadataField" value="SINGLE_METADATA_NAME"/>
</bean>

Is it possible to create a type of combined ordering like the one described? If so, how could I operate?

Thank you in advance!


Solution

  • Sorting via a list of metadataFields currently isn't possible in DSpace's Discovery module.

    DiscoverySortFieldConfiguration only supports a single metadataField as noted in the documentation at: https://wiki.duraspace.org/display/DSDOC6x/Discovery#Discovery-Sortoptioncustomizationforsearchresults

    You can also see that the code itself only supports one field: https://github.com/DSpace/DSpace/blob/dspace-6_x/dspace-api/src/main/java/org/dspace/discovery/configuration/DiscoverySortFieldConfiguration.java#L17