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

Add pagination for FacetValues #1257

Closed
bobby91560 opened this issue Dec 6, 2021 · 10 comments
Closed

Add pagination for FacetValues #1257

bobby91560 opened this issue Dec 6, 2021 · 10 comments

Comments

@bobby91560
Copy link

Hello 👋
Is your feature request related to a problem? Please describe.
In our DB, we have a lot of FacetValues for a single Facet, like a city facet that contains a large list of facetValue as city name.
Sometimes we want to query to get all the facetValues from a facet. In order to optimize our performance, we want to paginate the results of it.

Describe the solution you'd like
Like the FacetService, for the query :
findAll(ctx: RequestContext, options?: ListQueryOptions<Facet>)

We would like to have the same for the FacetValueService
findByFacetId(ctx: RequestContext, id: ID, options?: ListQueryOptions<FacetValue>)

@michaelbromley
Copy link
Member

Hi,

We had a similar issue some time ago with Product.variants which is just a flat array of all variants. So to solve that I added the variantsList field, which is a paginated list type. At the service layer, it was implemented in the same way that you describe here.

So I think this is a worthy addition and I'll add it at some point. Unfortunately just missed out on making it into the next minor release, but potentially the one after that.

@bobby91560
Copy link
Author

No problem it's not urgent for us now but thanks to take it in account 🙏

@giosueDelgado
Copy link
Collaborator

For me is a little bit more urgent not only for the service layer but also in the admin-ui is important to have because is impossible to edit when you have thousand of facet value. For the admin-ui I add a specific issue because the issue is that you cannot save when there are many many facetvalues in the same facet.

@giosueDelgado
Copy link
Collaborator

Is there some update on it?

I see planned but I do not understand which milestone

Thanks

@floze
Copy link
Contributor

floze commented Jul 25, 2023

+1 any update on this? Admin-UI is kind of broken with lots of facet values...

@michaelbromley
Copy link
Member

Hi all!

Thanks for bringing my attention back to this one.

@floze how many facet values are we talking? And is it just the facet detail page that is kind of broken?

@michaelbromley michaelbromley moved this from 📅 Planned to 📋 Backlog in Vendure OS Roadmap Jul 25, 2023
@floze
Copy link
Contributor

floze commented Jul 26, 2023

@michaelbromley It's not just the facets-detail page, although the facets-overview page (/admin/catalog/facets) at least seems to render completely, albeit with heavy load. The problem is not so much the backend, but the browser that appears to be choking on the rendering. I'm using Brave, but Safari seems to be affected as well.

As @giosueDelgado mentioned, the problem seems to arise with thousands of values per facet, hundreds are still loading nicely on my end.

@giosueDelgado
Copy link
Collaborator

Hi yes we have 2/3k of facet values... on some facet

@michaelbromley
Copy link
Member

OK thanks both for the feedback.

I'm gonna look into the best fix for now - which might be just to make the Admin UI smarter and not try to render everything. If this handles the immediate perf issues I can possibly get this in the next patch.

@michaelbromley
Copy link
Member

OK I have started implementing the fix for this in the minor branch. Still need to do the facet detail page, which is quite a bit more complex.

@michaelbromley michaelbromley moved this from 📋 Backlog to 🏗 In progress in Vendure OS Roadmap Sep 22, 2023
@michaelbromley michaelbromley moved this from 🏗 In progress to 🔖 Ready in Vendure OS Roadmap Sep 22, 2023
@michaelbromley michaelbromley moved this from 🔖 Ready to ✅ Done in Vendure OS Roadmap Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🚀 Shipped
Development

No branches or pull requests

4 participants