Routing and Autocomplete

I was able to implement routing with instantsearch without problems.

I would like to know if routing can also be implemented with autocomplete. Is there any way? I was unable to find anything on the web.

With instantsearch i’m doing something like it:

const t = algoliasearch("********", "*************************"),
    e = instantsearch({
        indexName: "index_name",
        searchClient: t,
        routing: {
            stateMapping: instantsearch.stateMappings.singleIndex("index_name")
        }
    });

Is there any way to do it with autocomplete dropdown too? Thank you

Hello, any update? it is just possibile to use routing with autocomplete?

Usually, as autocomplete only represents part of your page, it’s uncommon to see routing implemented for such implementations.
Which system are you using for your autocomplete?

  • The autocomplete widget of instantsearch.js
  • Or our autocomplete.js library?

Hi, thanks for the reply, it is perhaps uncommon but I had thought of implementing it as I have always used it for instantsearch, now I have decided to remove instantsearch and use the autocomplete on my platform.

I currently use these two scripts:

<script src="https://cdn.jsdelivr.net/npm/algoliasearch@3.32.0/dist/algoliasearchLite.min.js"></script>
<script src="https://cdn.jsdelivr.net/autocomplete.js/0/autocomplete.min.js"></script>

This isn’t possible with v0 of autocomplete, but the next upcoming version will have this feature. You can read more on the experimental docs site for that next version: https://autocomplete-experimental.netlify.app/docs/state

Thanks for the clarification I will wait for the next version.

Now I’m not sure why I’m using version v0, are there other versions of autocomplete? How do they differ?

Hi @giacomosilli, this is the only version we have available at this time.

Hi @cindy.cullen, ok, thanks for the clarification, probably the other links I have seen of autocomplete.js perhaps differed only in the name, but the script was the same.

great product.

3 Likes