Skip to content
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

Search API - Pagination #235

Closed
tmushayahama opened this issue Jul 12, 2019 · 4 comments
Closed

Search API - Pagination #235

tmushayahama opened this issue Jul 12, 2019 · 4 comments
Assignees

Comments

@tmushayahama
Copy link
Contributor

From #230 spec.

For pagination and faster queries,, the purpose of n is for bounds it should be the total matching (independent of limit value) so that pagination can happen. i.e to calculate offset/page pages = n/limit .

limit = pagesize
pages = total matching (n) / limit
offset = page *limit

@goodb
Copy link
Contributor

goodb commented Jul 12, 2019

Not sure if that is possible without issuing a count query first and then the data query. Seems like it would be slow, though it could be done.

Why not simply iterate over what is returned until you hit the end? e.g. always grab chunks of 100 rows at a time, when you hit one where n is < 100 then you know you are done. That saves doing the additional count query and in most cases you will never get past the first result in the UI.

@tmushayahama
Copy link
Contributor Author

@goodb @balhoff any update on this. I think they want to see the matched count @vanaukenk @thomaspd we once had a conversation about displaying the matched models after a search. in ART.

I can do a separate count call. but i don't know if it the api is available

@goodb
Copy link
Contributor

goodb commented Sep 16, 2019

@tmushayahama we should separate pagination requirements from count requirements. Which do the users need?

I believe you can achieve pagination given the existing API as I described above.

If you need a specific result count, we will need to adapt the API.

@tmushayahama
Copy link
Contributor Author

@goodb I think for now just the count for display purposes.

goodb added a commit that referenced this issue Oct 1, 2019
…-issue235

adding result count request parameter #235 and #230
goodb added a commit that referenced this issue Jan 17, 2020
goodb added a commit that referenced this issue Jan 17, 2020
@goodb goodb closed this as completed Mar 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants