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

[FEATURE-REQUEST] custom_index_query should receive all rather than paged #278

Open
juantascon opened this issue Jul 10, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@juantascon
Copy link

juantascon commented Jul 10, 2023

Describe the problem you're proposing to solve

Use of custom_index_query is very limited since it only works on the currently paged view. When you have a custom index query that returns fewer items this issue leads to invalid total numbers and invalid page counts.

Describe the solution you'd like

custom_index_query should be used to limit the whole query rather than just the currently paged query, i.e here we should pass all rather than paged, then build the filtered query from there on.

Describe alternatives you've considered

Perhaps add a new custom_query instead?

Additional context

This type of query breaks records counting and pagination (it shows more pages than there are) work:

def custom_index_query(_conn, _schema, query) do
    from(r in query, distinct: r.my_custom_field)
end
@juantascon juantascon added the enhancement New feature or request label Jul 10, 2023
@juantascon
Copy link
Author

@aesmail I can provide a pullrq if you point me to what solution you prefer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants