-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue on docs #116
Comments
@tinneyi Many thanks for this and sorry about the very late reply. We have recently changed the docs on pagination and recommend timestamp-based pagination for most users: https://axiom.co/docs/restapi/pagination Could you please let me know if this addresses your concerns? |
Hi Mano,
I coded around the problem, so I'm all good now, thanks.
For reference, this is what works well for me:
"""
DEFAULT BEHAVIOUR
** If not using pagination,
* If limit option is not supplied, Axiom will return 1000 results
* If limit option is supplied, limit defines number of results to return
(as expected)
but since the maximum page size in Axiom is 50,000, a max. of 50,000
results will be returned.
** If using pagination,
* If limit option is not supplied, Axiom will return 1000 results
* If limit option is supplied, limit flips to becoming the "page_size",
NOT number of results to return (as would be expected)
THIS SCRIPTS CHANGES THE DEFAULT BEHAVIOUR IN THIS WAY
** If using pagination,
* If limit option is supplied, limit is artificially made to mimic the
behaviour
of limit without pagination, and page_size is set to 50,000, unless
page_size is
greater than limit, in which case page_size is set to limit (number of
events to return)
"""
For me, the timestamp-based method introduces a new problem of duplicate
events at the boundaries, so I would prefer to stick with the cursor method
now I have it working well.
Kind regards,
Ian.
…On Wed, 8 Jan 2025 at 10:24, Mano Toth ***@***.***> wrote:
@tinneyi <https://github.com/tinneyi> Many thanks for this and sorry
about the very late reply.
We have recently changed the docs on pagination and recommend
timestamp-based pagination for most users:
https://axiom.co/docs/restapi/pagination
Could you please let me know if this addresses your concerns?
—
Reply to this email directly, view it on GitHub
<#116 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/A37AFOHM54UTO36BNXMVPST2JT4E3AVCNFSM6AAAAABP7R4UHGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNZXGMYTQOJWGY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@tinneyi Many thanks for the detailed explanation. I'm sorry you had to figure this out yourself. We will do our best to provide better guidance and quicker responses in the future. |
Path: /restapi/pagination
Your docs state:
_The minCursor and maxCursor fields in the response are boundaries that help you page through the result set.
For queries with descending order (_time DESC), use minCursor from the response as the cursor in your next request to go to the next page. You reach the end when your provided cursor matches the minCursor in the response.
For queries with ascending order (time ASC), use maxCursor from the response as the cursor in your next request to go to the next page. You reach the end when your provided cursor matches the maxCursor in the response.
But this is not quite the whole story.
Descending
If your sort is "desc" then minCursor starts at a non-zero value and each pagination is counts down until it reaches zero. At this point we know we have all the results.
EXAMPLE 1:
POST for first 10000 records of 28176.
POST for second 10000 records of 28176.
POST for third and final 10000 records of 28176
Ascending
However, if you sort ascending, the minCursor begins at zero, then increments until the last page of results, then it returns to zero.
EXAMPLE 2:
POST for first 10000 records of 28176.
POST for second 10000 records of 28176.
POST for third and final 10000 records of 28176
QUESTION:
For ascending sorts, because minCursor starts and end at xero, how do I know that I didn't already receive all the records in the first POST.
EXAMPLE 3:
Here I ask for the first 30,000 of 28,176 results, which will return the whole result set in one go:
But, I don't know that there are no more records, so I make a second POST using the maxCursor:
I cannot see any way to correctly identify that there are no more records to ask for.
The text was updated successfully, but these errors were encountered: