To query large outputs or large number of fragments across all anchors, we need to provide pagination for Query API( query data nodes across all anchors). it will help client to fetch limited set of data per request. below is two possible solutions for further discussions to decide appropriate choice.
Jira Refs :
Jira Legacy |
---|
server | System Jira |
---|
columnIds | issuekey,summary,issuetype,created,updated,duedate,assignee,reporter,priority,status,resolution |
---|
columns | key,summary,type,created,updated,due,assignee,reporter,priority,status,resolution |
---|
serverId | 4733707d-2057-3a0f-ae5e-4fd8aff50176 |
---|
key | CPS-1605 |
---|
|
Issues and Decisions
# | Issues | Notes | Decision |
---|
1 | How to support pagination. | we need to decide on how to support pagination for query API from two possible alternatives given below (pagination over fragments or pagination over anchors) |
|
2 | Default page size | should we go with some default page size or query all records if pagination parameter in not provided. |
|
...
Parameter | isRequired | Description |
---|
cps-path | yes | node path to be queried |
descendants | no | Number of descendants to be queried. default is none.. |
pageIndex | no | page index starting from 1. default is -1 for all records. |
resultSize | no | number of fragments per page starting from 10 (TBD). pag. default is -1 for all fragments.. |
Query | Description |
---|
SELECT id, anchor_id AS anchorId, xpath, parent_id AS parentId, CAST(attributes AS TEXT) AS attributes FROM FRAGMENT WHERE xpath ~ :xpathRegex ORDERED BY id LIMIT :resultSize OFFSET (:resultIndex - 1) * :resultSize | Query limited fragments in order of fragment id |
|
|
...
Parameter | isRequired | Description |
---|
cps-path | yes | node path to be queried |
descendants | no | Number of descendants to be queried. default is none |
pageIndex | no | page index starting from 1. default is -1 for all pages(all anchors) |
pageSize | no | number of records per request. It is nothing but number of anchors to be queried. Default value is 5(TBD).-1 for all pages(all anchors) |
Header | description |
---|
totalResults | total number of available records (achors) |
totalPages | total nulber of pages. |
...