Using Geo Location in Typesense Search Queries
TLDR GM is trying to use geo location in search queries using Typesense. Jason demonstrated the usage of an alias in the query and explained where to use it. However, GM has further questions on adding conditional searches.
Oct 25, 2022 (14 months ago)
GM
05:38 PMq: '*',
query_by: 'ADDRESS_CITY',
filter_by: 'COORDINATES:(' + latitude + ',' + longitude + ', ' + radious + ')',
sort_by: 'COORDINATES(' + latitude + ',' + longitude + '):asc',
};
const results = (await typesense.aliases('active-sites').retrieve()).name.search(searchParameters);
Jason
05:39 PMGM
05:40 PMJason
05:40 PMtypesense.collections('active-sites').documents().search(searchParameters)
Jason
05:40 PMactive-sites
is an alias nameGM
05:41 PMGM
05:42 PMTypesense
Indexed 3011 threads (79% resolved)
Similar Threads
Using TypeSense for Geolocation Tagged Job Search
Nicholas needed help to enable geo-location based job search on a board. James suggested using filter_by from TypeSense, while Jason elaborated on 'OR' and 'AND' operations in TypeSense.
Typesense Query Construction for Branch Locator
Lily needed confirmations on their typesense implementation for a location-based feature. Jason affirmed their approach.
Using Aliases in Typesense Search Queries
Babin had a question about using aliases in Typesense search queries, specifically when passing collection names. Jason helped identify a misconfiguration and provided guidance, resolving the issue.