Sorting constant moved and renamed

This commit is contained in:
Adan Roman
2022-12-20 10:39:30 +01:00
parent 193f0a4750
commit 027c79e341
4 changed files with 9 additions and 9 deletions

View File

@@ -31,7 +31,7 @@ import org.dspace.content.DSpaceObject;
import org.dspace.content.Item;
import org.dspace.content.factory.ContentServiceFactory;
import org.dspace.content.service.BitstreamService;
import org.dspace.content.service.DSpaceObjectService;
import org.dspace.content.service.CollectionService;
import org.dspace.content.service.WorkspaceItemService;
import org.dspace.core.Constants;
import org.dspace.core.Context;
@@ -879,7 +879,7 @@ public class AuthorizeServiceImpl implements AuthorizeService {
query = formatCustomQuery(query);
DiscoverResult discoverResult = getDiscoverResult(context, query + "search.resourcetype:" +
IndexableCollection.TYPE,
offset, limit, DSpaceObjectService.COMMUNITIES_AND_COLLECTIONS_SORT_FIELD, SORT_ORDER.asc);
offset, limit, CollectionService.SOLR_SORT_FIELD, SORT_ORDER.asc);
for (IndexableObject solrCollections : discoverResult.getIndexableObjects()) {
Collection collection = ((IndexableCollection) solrCollections).getIndexedObject();
collections.add(collection);

View File

@@ -947,7 +947,7 @@ public class CollectionServiceImpl extends DSpaceObjectServiceImpl<Collection> i
discoverQuery.setDSpaceObjectFilter(IndexableCollection.TYPE);
discoverQuery.setStart(offset);
discoverQuery.setMaxResults(limit);
discoverQuery.setSortField(COMMUNITIES_AND_COLLECTIONS_SORT_FIELD, SORT_ORDER.asc);
discoverQuery.setSortField(SOLR_SORT_FIELD, SORT_ORDER.asc);
DiscoverResult resp = retrieveCollectionsWithSubmit(context, discoverQuery, null, community, q);
for (IndexableObject solrCollections : resp.getIndexableObjects()) {
Collection c = ((IndexableCollection) solrCollections).getIndexedObject();
@@ -1027,7 +1027,7 @@ public class CollectionServiceImpl extends DSpaceObjectServiceImpl<Collection> i
discoverQuery.setDSpaceObjectFilter(IndexableCollection.TYPE);
discoverQuery.setStart(offset);
discoverQuery.setMaxResults(limit);
discoverQuery.setSortField(COMMUNITIES_AND_COLLECTIONS_SORT_FIELD, SORT_ORDER.asc);
discoverQuery.setSortField(SOLR_SORT_FIELD, SORT_ORDER.asc);
DiscoverResult resp = retrieveCollectionsWithSubmit(context, discoverQuery,
entityType, community, q);
for (IndexableObject solrCollections : resp.getIndexableObjects()) {

View File

@@ -33,6 +33,11 @@ import org.dspace.eperson.Group;
public interface CollectionService
extends DSpaceObjectService<Collection>, DSpaceObjectLegacySupportService<Collection> {
/*
* Field used to sort community and collection lists at solr
*/
public static final String SOLR_SORT_FIELD = "dc.title_sort";
/**
* Create a new collection with a new ID.
* Once created the collection is added to the given community
@@ -46,7 +51,6 @@ public interface CollectionService
public Collection create(Context context, Community community) throws SQLException,
AuthorizeException;
/**
* Create a new collection with the supplied handle and with a new ID.
* Once created the collection is added to the given community

View File

@@ -52,10 +52,6 @@ public interface DSpaceObjectService<T extends DSpaceObject> {
= new MetadataFieldName(DC, "format");
public static final MetadataFieldName MD_SOURCE
= new MetadataFieldName(DC, "source");
/*
* Field used to sort community and collection lists at solr
*/
public static final String COMMUNITIES_AND_COLLECTIONS_SORT_FIELD = "dc.title_sort";
/**
* Generic find for when the precise type of an Entity is not known