mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-16 14:33:09 +00:00
CST-5249 find Topic order by QAevent.key, means by the topic name
This commit is contained in:
@@ -27,11 +27,9 @@ public interface QAEventService {
|
||||
* Find all the event's topics.
|
||||
*
|
||||
* @param offset the offset to apply
|
||||
* @param pageSize the page size
|
||||
* @return the topics list
|
||||
*/
|
||||
public List<QATopic> findAllTopics(long offset, long pageSize);
|
||||
|
||||
public List<QATopic> findAllTopics(long offset, long count, String orderField, boolean ascending);
|
||||
/**
|
||||
* Find all the event's topics related to the given source.
|
||||
*
|
||||
@@ -40,7 +38,8 @@ public interface QAEventService {
|
||||
* @param count the page size
|
||||
* @return the topics list
|
||||
*/
|
||||
public List<QATopic> findAllTopicsBySource(String source, long offset, long count);
|
||||
public List<QATopic> findAllTopicsBySource(String source, long offset, long count,
|
||||
String orderField, boolean ascending);
|
||||
|
||||
/**
|
||||
* Count all the event's topics.
|
||||
|
@@ -36,6 +36,7 @@ import org.apache.solr.client.solrj.response.QueryResponse;
|
||||
import org.apache.solr.common.SolrDocument;
|
||||
import org.apache.solr.common.SolrDocumentList;
|
||||
import org.apache.solr.common.SolrInputDocument;
|
||||
import org.apache.solr.common.params.FacetParams;
|
||||
import org.dspace.content.Item;
|
||||
import org.dspace.content.QAEvent;
|
||||
import org.dspace.content.service.ItemService;
|
||||
@@ -188,12 +189,13 @@ public class QAEventServiceImpl implements QAEventService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<QATopic> findAllTopics(long offset, long count) {
|
||||
return findAllTopicsBySource(null, offset, count);
|
||||
public List<QATopic> findAllTopics(long offset, long count, String orderField, boolean ascending) {
|
||||
return findAllTopicsBySource(null, offset, count, orderField, ascending);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<QATopic> findAllTopicsBySource(String source, long offset, long count) {
|
||||
public List<QATopic> findAllTopicsBySource(String source, long offset, long count,
|
||||
String orderField, boolean ascending) {
|
||||
|
||||
if (source != null && isNotSupportedSource(source)) {
|
||||
return null;
|
||||
@@ -201,6 +203,8 @@ public class QAEventServiceImpl implements QAEventService {
|
||||
|
||||
SolrQuery solrQuery = new SolrQuery();
|
||||
solrQuery.setRows(0);
|
||||
solrQuery.setSort(orderField, ascending ? ORDER.asc : ORDER.desc);
|
||||
solrQuery.setFacetSort(FacetParams.FACET_SORT_INDEX);
|
||||
solrQuery.setQuery("*:*");
|
||||
solrQuery.setFacet(true);
|
||||
solrQuery.setFacetMinCount(1);
|
||||
|
Reference in New Issue
Block a user