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

AdvancedSearch Schema not ideal for product grouping #2

Open
elauser opened this issue Jan 16, 2023 · 0 comments
Open

AdvancedSearch Schema not ideal for product grouping #2

elauser opened this issue Jan 16, 2023 · 0 comments

Comments

@elauser
Copy link

elauser commented Jan 16, 2023

The Vendure search implementation is made with a variant based approach in mind.
I made a webshop using the AdvancedSearch where the requirements were set on a variant based search and it worked great! Fully typed searchInput and response thanks to GraphQl codegen.

We have customers where we want the results and counts grouped by product, and the schema should return a list of products not the first variant of each product.
They often have products with more than 100 variants and to not just show 10 pages filled with variants of the same product having it grouped by product is necessary. Since they also want to show the price of the variant they have a variant selector on each product card.
https://webshop.stocker.alpin11.dev/category/polyline-pp

The current workaround discussed with @michaelbromley where we add all the variants on each indexed variant as a JSON serialized string would require extra filtering in the frontend afterwards to remove all the variants which don't pass the facet filter.

Also the collection count doesn't match with the typesense count somehow.
image

I think to do that we could create a second endpoint returning a different schema instead of just setting the groupByProduct flag and returning one variant per product and hackily adding extra values.

Typesense supports grouping, and we implemented it by grouping by product_id and setting the maximum group_limit
https://typesense.org/docs/0.23.1/api/search.html#grouping-parameters

We could take over development for that feature if the AdvancedSearch Plugin source gets made available to us and you think that this is a valid way to extend the Search.

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

1 participant