algolia / dynamic-faceting-instant-search-guide

16 stars 5 forks source link

routing option doesn't work with the custom widget #3

Open ElHamster opened 5 years ago

ElHamster commented 5 years ago

Hi,

when i try to activate the routing option for instantsearch the widget doesn't add the refinement to the url.

Fork from your example with routing on: https://codesandbox.io/s/p96k2xm8w0

Maybe you can add this to your example.

Haroenv commented 5 years ago

That's correct, I didn't write this guide, but the custom widget would need to add the following APIs:

This can be seen in e.g. the official menu connector:

https://github.com/algolia/instantsearch.js/blob/3bd6c85b02679c661c12a02be1c5b626f69dd517/src/connectors/menu/connectMenu.js#L248-L290

ElHamster commented 5 years ago

Ok i'm not really sure how I should implement this. Because in the menu there is only one attribute to manage and for the dynamic faceting a number of X (in my case over 1000) for the URL. Yes i can built it up with the attribute "dynamic_facetting" but in the url i need the real attributes like price, size, brand etc.