Instantsearch.js: Feature Request: Allowing Attributes to be mapped in urlSync

Created on 4 Jan 2017  路  7Comments  路  Source: algolia/instantsearch.js

Hello,

I'm using Algolia on a project that I'm working with, but I've struggled on a step. I hope you guys can assist me here:

Currently, this is the decoded url structure of my search parameter:

urlSync: {
        useHash: false,
        mapping: {
          q: 'ara',
          p: 'sayfa'
        },
        trackedParameters: [
            'query', //q
            'attribute:color',
            'attribute:brand',
            'page' //p
        ]
  },

ara=query&sayfa=0&dFR[brand][0]=brandname&dFR[color][0]=colorname&is_v=1

But for a cleaner structure, I want to achieve something like this:

ara=query&sayfa=0&brand=brandname&color=colorname&is_v=1

And for multiple occasions, maybe something like this:

ara=query&sayfa=0&brand=brandname1,brandname2&color=colorname1,colorname2&is_v=1

So in short, how do I change &dFR[attribute][0]=value to &attribute=value, at least to &attribute[0]=value

I'm using instantsearch.js 1 from cdn in pro plan, if that would matter.

Any idea would be appreciated.

Thanks in advance,

API Core

Most helpful comment

Now that we've released we are going to be able to work on this kind of feature.

PS: don't forget to 馃憤 this first comment so that we can sort the issue by interest :)

All 7 comments

Hi @Ardakilic Sorry we don't offer such flexibility for now :( However we're thinking hard on how it would be best to add this without crippling the API.

Hey @bobylito , thanks for the reply! Actually, in addition to search page, I'm planning to use instantsearch.js as category pages on the project I'm working with, since it's capable for every feature we need already, and cleaner URL for SEO and old pages' migration is important on this step for me.

I'd appreciate if this would be considered at least for possible different use cases just like mine.

Thank you again for the interest, much appreciated!

need this feature, +1

this feature important +1

+1!
Be a huge value to have flexibility of options for masking the url params some way.

Now that we've released we are going to be able to work on this kind of feature.

PS: don't forget to 馃憤 this first comment so that we can sort the issue by interest :)

This will be solved with #2216 and more specifically an API like the proposed in #2636. Have a look, there are demos with the source code.

Closing this for now.

Was this page helpful?
0 / 5 - 0 ratings