Please help with geo filter using instantsearch.js...
# community-help
p
Please help with geo filter using instantsearch.js. I am totally confused with provided typesense documentation on filter_by using the Configure instantsearch widget. I have an array of geopoint[]. I am repeatedly getting unfiltered listing and i want to dynamically filter. I see no example of using configure for filter_by for geoPoints. Ofcourse, I cant have location as facet which is mentioed in link here. https://github.com/typesense/typesense-instantsearch-adapter/issues/17#issuecomment-746912375
f
This demo here: https://github.com/typesense/showcase-airbnb-geosearch Uses geosearch and you can use this as an example to iterate on
p
Hi @Fanis Tharropoulos thanks for this link. But this one uses geoSearch widget. I am looking for an example where I collect lat, lng from google map and use this to filter. I am unable to use filter_by or how to use it in configure widget. Or any other way i can filter by geo points. I am not looking for map view search.
f
You'd use the refinement list widget for that
p
refinementList on latititude longitudes? Will be bad idea. There must be a way in instantsearch. Typesense filter_by in additionalSearchParameter works only during initial load time.
Ahhh... i got this working. I was actually using
Copy code
configure({
    hitsPerPage: 10,
    filter_by: `location:(${initialLat}, ${initialLng}, ${searchRadius} km)`,  -----> wrong
}),          

configure({
   hitsPerPage: 10,
   filters: `location:(${initialLat}, ${initialLng}, ${searchRadius} km)`,  ------> right way
}),
1