mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
ALF-11319 Work around the fact that Filtered Lucene Results don't support start/hasMore calls, so the new services using these for tag queries (links and discussion) need to handle that if the results were filtered
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@32158 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -435,14 +435,33 @@ public class LinksServiceImpl implements LinksService
|
||||
@Override
|
||||
public boolean hasMoreItems()
|
||||
{
|
||||
return finalLuceneResults.hasMore();
|
||||
try
|
||||
{
|
||||
return finalLuceneResults.hasMore();
|
||||
}
|
||||
catch(UnsupportedOperationException e)
|
||||
{
|
||||
// Not all lucene results support paging
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pair<Integer, Integer> getTotalResultCount()
|
||||
{
|
||||
int skipCount = finalLuceneResults.getStart();
|
||||
int itemsRemainingAfterThisPage = finalLuceneResults.length();
|
||||
int skipCount = 0;
|
||||
int itemsRemainingAfterThisPage = 0;
|
||||
try
|
||||
{
|
||||
skipCount = finalLuceneResults.getStart();
|
||||
}
|
||||
catch(UnsupportedOperationException e) {}
|
||||
try
|
||||
{
|
||||
itemsRemainingAfterThisPage = finalLuceneResults.length();
|
||||
}
|
||||
catch(UnsupportedOperationException e) {}
|
||||
|
||||
final int totalItemsInUnpagedResultSet = skipCount + itemsRemainingAfterThisPage;
|
||||
return new Pair<Integer, Integer>(totalItemsInUnpagedResultSet, totalItemsInUnpagedResultSet);
|
||||
}
|
||||
|
Reference in New Issue
Block a user