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:
Alexandre Vryghem
2023-03-30 15:38:09 +02:00
parent 4cdb66267e
commit a11ed8a0d3
2 changed files with 2 additions and 0 deletions

View File

@@ -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;
}

View File

@@ -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;
}