[
https://issues.apache.org/jira/browse/SLING-11230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17515019#comment-17515019
]
Dan Klco commented on SLING-11230:
----------------------------------
[~cziegeler] / [~bdelacretaz] I see this as a more limited scope than
SLING-4752. From my reading, the intent of SLING-4752 is to create a library
for writing queries in code independent of the JCR Query implementation.
I see the goal of this ticket is to provide a services for developers to create
and execute queries with the ability to influence how these queries are
executed and have the result of these queries be Iterable Sling Resources.
I don't see a good reason to specifically tie this to the JCR implementation of
search and agree having the service take a resource resolve and then using
ResourceProviders to determine how to execute the actual queries makes sense.
> Support Limit and Offset via JcrResourceProvider / findResources
> ----------------------------------------------------------------
>
> Key: SLING-11230
> URL: https://issues.apache.org/jira/browse/SLING-11230
> Project: Sling
> Issue Type: Improvement
> Components: JCR
> Reporter: Dan Klco
> Assignee: Dan Klco
> Priority: Minor
>
> *Problem Statement*
> In addition to not supporting global limits, there are good reasons that a
> developer may want to return only a sub-set of the query results when
> executing a query. For example returning the 10 latest uploaded files.
> Currently this can be accomplished by executing a query and then only
> iterating to the 10th item, however a much larger query set may be fetched
> from the node store than required to service the intended use case.
> In addition, to support paging, the current implementation would require
> retrieving and iterating over the Resources until the desired start point is
> found then reading the subsequent Resources.
> _However_ changing the API contract for the ResourceResolver to either add a
> new method with the start and limit values would have a non-insignificant
> ripple effect into the implementations, mocks and providers which would be
> required to support this new method.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)