You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Collections can currently be fetched with id or slug in the collection query. It would also be nice to be able to search the products with a slug in the search query. With this, the collection and product search data could be fetched with the same request.
Describe alternatives you've considered
Executing the collection query first to get the ID and then the search query, but this would increase the loading time and require two requests. Currently I have a file that maps the slugs to their IDs.
The text was updated successfully, but these errors were encountered:
In the resolver, check to see if the collectionSlug field is truthy. If so, query the Collection id based on the slug, then use the id in the same way it already works. Pro: No changes need to indexing Con: An additional DB query needed when using the slug to search.
Index the slug as part of the search index. Pro: No additional query needed, better perf at search time. Con: Need to index the slug in each supported language. Need listen for CollectionModificationEvent and update search index items when the slug changes.
Actually we already listen for CollectionModificationEvent so the second option would probably be preferable, also since the runtime performance will be better - searches are performed orders of magnitude more often than collection updates. In that case it would be a schema change for the DefaulSearchPlugin and therefore a breaking change - next minor release.
Is your feature request related to a problem? Please describe.
Collections can currently be fetched with id or slug in the
collection
query. It would also be nice to be able to search the products with a slug in thesearch
query. With this, the collection and product search data could be fetched with the same request.Describe the solution you'd like
Describe alternatives you've considered
Executing the
collection
query first to get the ID and then thesearch
query, but this would increase the loading time and require two requests. Currently I have a file that maps the slugs to their IDs.The text was updated successfully, but these errors were encountered: