mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
ALF-9385. Passed pagingReq skipCount and maxItems through to the Lucene query. Also removed some unnecessary logging.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@28990 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -301,6 +301,10 @@ public class BlogServiceImpl implements BlogService
|
||||
sp.setLanguage(SearchService.LANGUAGE_LUCENE);
|
||||
sp.setQuery(luceneQuery.toString());
|
||||
sp.addSort(ContentModel.PROP_PUBLISHED.toString(), false);
|
||||
|
||||
sp.setMaxItems(pagingReq.getMaxItems());
|
||||
sp.setSkipCount(pagingReq.getSkipCount());
|
||||
|
||||
ResultSet luceneResults = null;
|
||||
PagingResults<BlogPostInfo> results = null;
|
||||
try
|
||||
@@ -332,9 +336,10 @@ public class BlogServiceImpl implements BlogService
|
||||
@Override
|
||||
public Pair<Integer, Integer> getTotalResultCount()
|
||||
{
|
||||
int size = finalLuceneResults.getNodeRefs().size();
|
||||
//FIXME Impl
|
||||
return new Pair<Integer, Integer>(size, size);
|
||||
int skipCount = finalLuceneResults.getStart();
|
||||
int itemsRemainingAfterThisPage = finalLuceneResults.length();
|
||||
final int totalItemsInUnpagedResultSet = skipCount + itemsRemainingAfterThisPage;
|
||||
return new Pair<Integer, Integer>(totalItemsInUnpagedResultSet, totalItemsInUnpagedResultSet);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -407,16 +407,6 @@ public class BlogServiceImplTest
|
||||
final RangedDateProperty publishedAfter1980 = new RangedDateProperty(_1980, null, ContentModel.PROP_PUBLISHED);
|
||||
final RangedDateProperty publishedBetween1975And1985 = new RangedDateProperty(_1975, _1985, ContentModel.PROP_PUBLISHED);
|
||||
|
||||
List<ChildAssociationRef> children = NODE_SERVICE.getChildAssocs(BLOG_CONTAINER_NODE);
|
||||
for (ChildAssociationRef child : children)
|
||||
{
|
||||
Map<QName, Serializable> props = NODE_SERVICE.getProperties(child.getChildRef());
|
||||
System.out.println(props);
|
||||
System.out.println("cm:name " + props.get(ContentModel.PROP_NAME));
|
||||
System.out.println("cm:publ " + props.get(ContentModel.PROP_PUBLISHED));
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
// Find all
|
||||
PagingResults<BlogPostInfo> pagedResults = BLOG_SERVICE.findBlogPosts(BLOG_CONTAINER_NODE, null, null, pagingReq);
|
||||
assertEquals("Wrong number of blog posts", 3, pagedResults.getPage().size());
|
||||
|
Reference in New Issue
Block a user