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
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: