[
https://issues.apache.org/jira/browse/OAK-9319?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17468763#comment-17468763
]
Charles Grossman commented on OAK-9319:
---------------------------------------
Any update on this ticket?
> Returning the count of nodes based on search query
> --------------------------------------------------
>
> Key: OAK-9319
> URL: https://issues.apache.org/jira/browse/OAK-9319
> Project: Jackrabbit Oak
> Issue Type: Bug
> Components: oak-search, query
> Reporter: Vishnu Aggarwal
> Priority: Critical
>
> Is there a way to return the count of nodes for a given search query having
> different filtering clauses in a way, mimicking what we are able to do in an
> RDBMS query for eg., select count(*) from table_name where <condition>
> <and/or> <condition>;
>
> Can this be replicated in OAK without having to fetch all nodes in memory and
> calculating the count of all nodes?
>
> What the use case is to draw pagination.
> Let say, we are searching for 10(limit) nodes at a time. For that we use
> setLimit() and setOffset() on the query object.
> Also, we need the count of all nodes for that particular query to draw up the
> pages on front-end. For that, we have to make another search without the
> limit and offset, fetching all the nodes in memory and then making the count.
> But what it seems is, fetching all nodes takes up a lot of time ~ 1 min on
> the server (depending upon the size of nodes. ~ 1 min for ~10K nodes).
> Instead of that, if we are directly able to query to return the count of
> nodes that will prove beneficial and quicker way.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)