question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature Request: Allowing Attributes to be mapped in urlSync

See original GitHub issue

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,

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:7
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

6reactions
bobylitocommented, Jul 1, 2017

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 😃

0reactions
bobylitocommented, Dec 29, 2017

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sync your URLs with InstantSearch.js - Algolia
This guide goes through different ways to handle routing with your search UI: Enabling routing with no extra configuration; Manually rewriting ...
Read more >
Top 5 algoliasearch-helper Code Examples - Snyk
Allows every widget to alter the state at initialization // without trigger ... { moreAttributes: foreignConfig, mapping: this.mapping, safe: true } ); if ......
Read more >
instantsearch.js - UNPKG
instantsearch.js/dist/instantsearch.development.js.map ... and therefore all the known Algolia properties\n * This doesn't contain any beta/hidden features.
Read more >
How Algolia built their frontend search widgets with React.js ...
... indexName: options.index_name, urlSync: { mapping: { q: 'text', ... of out of box working functionality but also allows you to change ...
Read more >
@lsegurado/ls-element - npm
Does not require extensions to be identified by the IDE, ✓, ✓, ✓, ❌, ✓. Differentiation between attributes and properties in jsx / ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found