mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 01:54:22 +00:00
100553: Sort the queried metadata fields ASC to always display exact matches on top (this can otherwise lead to angular errors)
This commit is contained in:
@@ -64,6 +64,7 @@ public class MetadataFieldIndexFactoryImpl extends IndexFactoryImpl<IndexableMet
|
||||
Group anonymousGroup = groupService.findByName(context, Group.ANONYMOUS);
|
||||
// add read permission on doc for anonymous group
|
||||
doc.addField("read", "g" + anonymousGroup.getID());
|
||||
doc.addField(FIELD_NAME_VARIATIONS + "_sort", fieldName);
|
||||
return doc;
|
||||
}
|
||||
|
||||
|
@@ -210,6 +210,7 @@ public class MetadataFieldRestRepository extends DSpaceRestRepository<MetadataFi
|
||||
|
||||
DiscoverQuery discoverQuery = new DiscoverQuery();
|
||||
discoverQuery.addFilterQueries(filterQueries.toArray(new String[filterQueries.size()]));
|
||||
discoverQuery.setSortField("fieldName_sort", DiscoverQuery.SORT_ORDER.asc);
|
||||
return discoverQuery;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user