Hello,
I encountered a similar issue, and I found the following solution that
worked:
First, you need to add the custom sorting configuration to the
discovery.xml file:
*<bean id="sortDescriptionAbstract"
class="org.dspace.discovery.configuration.DiscoverySortFieldConfiguration">
<property name="metadataField" value="dc.description.abstract_sort"/>
<property name="defaultSortOrder" value="asc"/></bean>*
Next, modify the buildDocument() method in both
CollectionIndexFactoryImpl.java and CommunityIndexFactoryImpl.java by
adding the following line:
*doc.addField("dc.description.abstract_sort", description_abstract);*
This ensures that Solr properly indexes the field.
Then, update the findAll() method in the following classes:
CommunityRestRepository
CommunitySubcommunityLinkRepository
CommunityCollectionLinkRepository
Make sure to modify the sorting the original configuration
(discoverQuery.setSortField("dc.title_sort", DiscoverQuery.SORT_ORDER.asc))
to this:
*discoverQuery.setSortField("dc.description.abstract_sort",
DiscoverQuery.SORT_ORDER.asc);*
Finally, don’t forget to reindex DSpace to apply the changes:
*[dspace]/bin/dspace index-discovery -b*
After these changes, the sorting should work as expected on the community
list page.
Hope this helps!
Laszlo
[email protected] a következőt írta (2024. március 5., kedd, 8:37:21
UTC+1):
> We have been developing dSpace based repositories for 12 years, but now we
> have a problem, we can’t solve.
> This angular is brand new for us, thus we have to rewrite all our former
> changes we did formerly in dSpace both frontend and backend.
> So, our Community/Collection structure and list should cover the
> institutional logic, not the strict alphabetical order.
> It was easy to change until 6.x, where we changed the default sort field
> in CommunityServiceImpl.java and CollectionServiceImpl.java from dc.title,
> to dc.description.abstract and we hid the short description field in list,
> but wrote codes into it, according to our sort intentions.
> But now, I can’t find a solution, neither changes in backend, nor in
> frontend files won’t help.
> I have tried everthing, I have changed all dc.title field I found in ts
> and config files to dc.descrtiption.abstract, but nothing, I did the
> changes in java files written above.
> Of course I rebuilt backend, frontend and restarted angular even I
> reindexed solr.
> Do you have any idea, how to change?
>
> ps: I even changed the /src/app/core/pagination/pagination.service.ts
> defaultSortOptions to dc.description.abstract but nothing!!!
>
--
All messages to this mailing list should adhere to the Code of Conduct:
https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx
---
You received this message because you are subscribed to the Google Groups
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/dspace-tech/7066ec46-7c42-45f3-b06c-7388702f82f0n%40googlegroups.com.