Uploaded image for project: 'Repository'
  1. Repository
  2. REPOSITORY-206

Use jackrabbit API to get a query result count

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major Major
    • 4.0M5
    • None
    • Plugin
    • None

      Since jackrabbit 2.0, calling getSize() on a NodeIterator which results of an unordered query yields -1 (it's because of access limitation, the NodeIterator may skip results on the fly when iterating).

      A jackrabbit-only workaround exists: a getTotalSize() method exists in the QueryResultImpl class, which returns the total node count (introduced in https://issues.apache.org/jira/browse/JCR-1073), but may not be accurate for the reason of access limitation.

      In our case, as we do not use access limitation, the result should be exact. We could build our NodeIteratorIterable providing the getTotalSize from the query and return this size instead of the iterator's getSize if the latter is -1.

            Unassigned Unassigned
            ngavalda Nicolas Gavalda (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: