React Native Instant search locations - Filter by distance from user

instantsearch
filters
geosearch
#1

Hi there, I have implemented a search for React Native of many different locations. I am now trying to implement a way to filter by distance using a slider. The slider is moved to increase the maximum searching distance. My current implementation is to separately have a slider in React Native that periodically updates a component.

My question is, is there a specific proper way to do this with connectors? I have seen the RangeSlider that I am interested in however as far as I can tell there is no way to interact with results. As the distance to any place is dependant on the search parameters (the user location) and reflected in the “_rankingInfo” there is no attribute I can refine in this way.

Any info would be greatly appriciated :slight_smile:

#2

Hi there, if you want to update a search parameter like https://www.algolia.com/doc/api-reference/api-parameters/aroundRadius/ or any other geo search parameters (https://www.algolia.com/doc/api-reference/search-api-parameters/), you could use the Configure widget https://www.algolia.com/doc/api-reference/widgets/configure/react/ to dynamically update such a search parameter using any UI you want (such as a custom slider of yours).

Our own slider will only able to refine on attributes from the hits, not update global search parameters themselves.

Hope this answers your question.

#3

Hi there, thanks for your response. This is the exact implementation I have done :joy:

I was just wondering if there was a connector for this, but I guess not. Would be really nice to see this kinda thing implemented as a connector.