#filtering, sorting and pagination

2 messages · Page 1 of 1 (latest)

queen warren
#

Hello! I’m building an e-commerce application with around a million items. I need to give users the ability to apply filters in any order, sort by different fields, and paginate results.

For example, a user should be able to filter by a single-select language field, a multi-select category field, and free-text search by item name. They should also be able to sort by price, name, date added, etc. All filter combinations are supported, and every filter is optional.

I tried implementing this purely with Convex, but I’m having a hard time with its indexes, since they can only be used with fields in a specific order. In-memory sub-filtering does not work well with pagination and seems like the wrong direction.

I need help making an architectural decision: am I missing some Convex patterns, or do I need to introduce another search technology, such as Elasticsearch?

Thanks in advance!

raw trailBOT
#

Thanks for posting in #1088161997662724167.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.

    - Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
    - Use [search.convex.dev](https://search.convex.dev) to search Docs, Stack, and Discord all at once.
    - Additionally, you can post your questions in the Convex Community's #1228095053885476985 channel to receive a response from AI.
    - Avoid tagging staff unless specifically instructed.

    Thank you!