Hi, I have a Collection of products with name and ...
# community-help
r
Hi, I have a Collection of products with name and Geo-location as fields. When performing search, result should show the nearest product which match with query term. query:
Copy code
search?q=SEARCHTERM&query_by=name&filter_by=location:(LOCATION,RADIUS)&sort_by=location(LOCATION):asc
But the sorting is always show the nearest product first regardless of the match. I tried setting num_typos=0. It works. but even a slight mistake omit the product from response Is there any way to get the desired result?
j
@Ramees Could you try this query:
search?q=SEARCHTERM&query_by=name&filter_by=location:(LOCATION,RADIUS)&sort_by=_text_match:desc,location(LOCATION):asc
r
ok
I will try and let you know shortly
👍 1
Wow, It's working!
Thank you so much.
j
🙌
Happy to help!
r
You are awesome
😄 1