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.

Ability to enforce query parameters

See original GitHub issue

When doing a search on a subset of your dataset, the filter you used will show up in the currentRefinedValues and can show up in a refinement list.

This issue has no quick win :

  • We could add an exclude or filterData to every widget. This would work, but adds yet another type of needed logic to every widget and I’m definitely against it. However it remains a considerable option.
  • We could add some logic to the helper that would allow to flag some filters as being enforced, which would mean that we wouldn’t list them in the facetValues it sends back to the widgets.
  • Or we could do a simple thing, which requires adding some size to the JS client build (but if we go with https://github.com/algolia/algoliasearch-client-js/issues/179 , this is no issue) : add the generateSecuredAPIKey to the client, expose a privateSearchParameters to instantsearch, and generate a securedAPIKey that would contain these parameters in itself.

cc @redox .

And @vvo , we already have multiple use cases where this would be needed.

  • In Magento, in a specific category, you don’t want your users to be able to unrefine
  • In Magento, @maxiloc is using something like visibility: true
  • In Shopify, I have already two users using us on categories pages using tags.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:29 (29 by maintainers)

github_iconTop GitHub Comments

1reaction
pixelasticcommented, Jun 1, 2016

I think what @bobylito mentionned earlier about this being added to the helper would be the best solution here.

We will still need a way to pass this config to the helper from instantsearch, though. I really think this is not something that must be handled on a per-widget basis, but being in the core of the helper.

As usual, we could either give users access to the helper and let them configure this constants (but this requires to totally embrace the helper, document it completly, and so on). Or we could expose one more API entrypoint to instantsearch that delegates to the helper, with the added overhead of every new entrypoint we add to instantsearch…

I feel like we are pushing the limits of what can be done with a JavaScript search library. What is considered “advanced” use case today should be default basic options of the instantsearch.js of tomorow.

0reactions
vvocommented, Jun 9, 2016

At this point we do not have any clear proposal on this being a feature of the helper.

I think we should go with a more simple approach for now, I created #1064

Read more comments on GitHub >

github_iconTop Results From Across the Web

Query Parameters - Branch.io
Query parameters are a defined set of parameters attached to the end of a url. They are extensions of the URL that are...
Read more >
REST API Design Best Practices for Parameter and Query ...
Where to put the parameters for APIs? Best practices for parameter and query string usage in REST APIs.
Read more >
What Are Query Strings & Parameters - How to Optimize
Query parameters allow you to modify your website to deliver different experiences to your visitors. For example, say you're running three PPC ads...
Read more >
How to enforce data types in query parameters passed ...
I am trying to implement a route "/userdata" such that : The ideal responses from api should be as below: On error, displaying...
Read more >
Using parameters - Power Query - Microsoft Learn
Parameters give you the flexibility to dynamically change the output of your queries depending on their value, and can be used for: Changing...
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