AnsweredAssumed Answered

Need way to get total search result count (Urgent)

Question asked by satishvarmadandu on Dec 19, 2008
Hi,
  I am using webservices API (3c labs version) and when i search for anything, resultSet.getTotalRowCount() always returns the current batch size instead of actual total count. I found the following JIRA for this issue

https://issues.alfresco.com/jira/browse/ETWOONE-396

In that JIRA,  Roy Wetherall updated that the fix has been check-id on Dec-8th and the bug was closed.
I downloaded the Nightly build (dated Dec11), but still cannot get the total row count. Is this not fixed yet in the nightly build.

I looked into source code and i think the problem is with RepositoryQuerySession.java file
  public ResultSet getNextResults(ServiceRegistry serviceRegistry)
    {
        ResultSet queryResults = getQueryResults(serviceRegistry);
        ResultSetRow[] allRows = queryResults.getRows();
        ResultSetRow[] batchedRows = getNextResults(allRows);
        // Build the resultset for the batched results
       ……………………….
       batchedResults.setTotalRowCount(batchedRows.length);
        // Done
        return batchedResults;
    }

From my understanding, setTotalRowCount should be
batchedResults.setTotalRowCount(allRows .length); instead of batchedRows.length


To confirm whether the fix is there or not , i checked-out the code from SVN repository and i still see that batchedRows.length is getting set into setTotalRowCount.

So is this issue not resolved yet.

Can some one throw light on this.

Any help would be great.

Regards,
-Satish

Outcomes