This repository has been archived by the owner on Jul 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 46
Proper way to modify SearchParameters on the AlgoliaSearchHelper object? #84
Milestone
Comments
Indeed, would be cool to have something like: setQueryParameter : function setQueryParameter( param, value ) {
return this.mutateMe( function( m ) {
m[param] = value;
} );
}, What do you think @bobylito ? |
This is linked to #76 We need to propose that kind of feature. We often end up modifying multiple parameters at once, so having something more general like a setPartialState would eliminate the intermediate state created by the multiple calls to setQueryParameters. |
|
Sounds right! |
And what about |
Maybe |
Ok let's do that! :) |
bobylito
pushed a commit
that referenced
this issue
Jun 15, 2015
* FIX : #29 Avoid callback for outdated queries * FIX : #64 Sum up the processing time of all queries * FIX : #92 Parameters that can be set in the dashboard shouldn't have defaults * FIX : #62 Make sure disctinct is set to false when it's not possible to use distinct in Algolia * FEATURE : #91 Support for tags (with support for the raw format #98) * FEATURE : #70 Ability to get all refined values : helper.getRefinements( facetname ) * FEATURE : #51 multiple filters for a single conjunctive facet (tests) * FEATURE : Ability to modify any parameter of the state easily (#76 #84 #12) * FEATURE : #69 Ability to know if a facet is refined, whatever the value * FEATURE : #86 Expose SearchParameters, AlgoliaSearchHelper, SearchResults to users directly in the builds * FEATURE : #25 let the user do a clearRefinement with a function as a filter * REFACTORING : SearchParameters is immutable (#14) * REFACTORING : Ensure SearchParameters is totally frozen (#14) * LIB : Update lodash version to 3.9.x
dhayab
pushed a commit
to algolia/instantsearch
that referenced
this issue
Jul 10, 2023
…pdate a single parameter on SearchParameters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
On initialization of my helper I am setting a couple geo params. My initialization looks like this:
Working with the helper as my primary object, what I do not understand from looking at the docs is how do I update values like aroundRadius? I cannot mutate the helper so I can't just do:
I would expect to see some type of "helper.state.setOption()" type of method, but I don't see anything like that. All the setters I see seem to apply specifically to facets.
I was able to get this to work using the mutateMe method on the state object, but that seems pretty low level. Is there a better way to do this?
My final code for updating the aroudnRadius param looks like this:
The text was updated successfully, but these errors were encountered: