Details
-
Bug
-
Status: Closed
-
Resolution: No Longer Reproducible
-
6.1.0 CE GA1, 6.2.0 CE M2
-
Tomcat 7 + MySQL 5 6.2.x Git ID: e5e97a8681e24665344c8eb0589686c27cc4f36b.
Description
When you try to search objects of the Document Library (DLFileEntry) on a custom search portlet, it always returns 1 element, but with other elements like JournalArticle, it returns the right number of elements.
I'll explain:
I'm trying to do a custom search in a JSP file of a portlet via the following code
Indexer indexer = IndexerRegistryUtil.getIndexer(DLFileEntry.class); SearchContext sc = SearchContextFactory.getInstance(request); sc.setStart(QueryUtil.ALL_POS); sc.setEnd(QueryUtil.ALL_POS); sc.setGroupIds(new long[]{themeDisplay.getScopeGroupId()}); try { Hits hits = indexer.search(sc); Document [] documents = hits.getDocs(); %>Elements size: <%= documents.length %><br><% } catch (SearchException e) { %> SearchException: <%= e.getMessage() %><br> <% } %>
I checked in the Document Library, and it must return more than one element, but it always return only one. I tried to change the class name to JournalArticle, and it returned the rigth number of elements. I also checked its performance in the 6.0 version of Liferay and in that version, it returned more than one element.