#community-help

Handling Queryable Document Geographies in Lists

TLDR Jason asked how to handle multiple geographies in named lists of preferred sites. Jason suggested flattening all POIs in a list into a single 'geopoint[]' field, which satisfied Jason.

Powered by Struct AI

1

Nov 09, 2022 (13 months ago)
Jason
Photo of md5-c7ebbbcac16a1763e16d0e8e8177b0ae
Jason
04:19 AM
Hi, looking for suggestions on handling documents with multiple geographies (lat/lon).
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
04:37 AM
There’s a geopoint[] data type… But could you elaborate on how you’re looking to query the data?
Jason
Photo of md5-c7ebbbcac16a1763e16d0e8e8177b0ae
Jason
05:17 AM
Users are saving favorite things to named lists. We wish to surface these named lists as queryable. The lists consist of POIs with lat/lon geopoints and there is no geographical limitation on these lists… e.g., a single list could consist of POIs in multiple countires.

We wish to query these named lists for at least geopoint within a range.
05:18
Jason
05:18 AM
to better illustrate we are essentially trying to do a geopoint[][]
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
05:19 AM
Are the results shown to users, the list names, or the POI items inside the list?
Jason
Photo of md5-c7ebbbcac16a1763e16d0e8e8177b0ae
Jason
05:20 AM
Yes, a minimal amount of information… an image, name, owner, city, state or province.
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
05:21 AM
Let me rephrase that… Are the results shown to users:

a) the list names
OR
b) POI items inside the list
Jason
Photo of md5-c7ebbbcac16a1763e16d0e8e8177b0ae
Jason
05:21 AM
ah, a information on the lists.
05:22
Jason
05:22 AM
The pois are surfaced when a user selects a given list, outside of search.
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
05:24 AM
So when a user searches for “some term”, you want to return a list of “named lists”, where the POIs within that list are within X distance to the user, and the name (or any attribute) of the list has “some term” yeah?
Jason
Photo of md5-c7ebbbcac16a1763e16d0e8e8177b0ae
Jason
05:25 AM
essentially, the term is paired with a geopoint sort by
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
05:26 AM
You could just “flatten” all the geopoints of all the POIs in a list into a single geopoint[] field.
05:26
Jason
05:26 AM
For eg:
05:27
Jason
05:27 AM
{
  list_name: 'xyz',
  poi_geopoints: [ [lat1,lng1], [lat2,lng2], [lat3,lng3], ... ]
}
05:27
Jason
05:27 AM
where [lat1,lng1] is the geopoint associated with poi1 and so on
Jason
Photo of md5-c7ebbbcac16a1763e16d0e8e8177b0ae
Jason
05:29 AM
This is excellent; didn’t expect this to work actually.
05:29
Jason
05:29 AM
Thank you.

1

Typesense

Lightning-fast, open source search engine for everyone | Knowledge Base powered by Struct.AI

Indexed 3015 threads (79% resolved)

Join Our Community

Similar Threads

User-Specific Tagging and Filtering in UI

bnfd asked for the best way to create user-specific tags available on the UI. Jason suggested using personalized filters and creating a separate collection for each user's movies. The duo clarified the use of 'tags' in schemas and the refinementList widget in instantsearch. They also discussed various approaches to import and search large document collections.

1

46
29mo

Issues Sorting Multiple Fields with Sort_by in Typesense Query

Rishabh was having trouble sorting two fields separately with a single query. Jason explained that a secondary sorting will only occur if the first sort results in matching values. They clarified the functionality of sorting in various search engines.

3

34
34mo

Adjusting Text Match Score Calculation in TypeSense

Johannes wanted to modify the Text Match Score calculation in TypeSense to improve search results returns. With counsel from Jason and Kishore Nallan, various solutions were proposed, including creating a Github issue, attempting different parameters, and updating Docker to a new version to resolve the matter.

3

48
19mo

Moving from Algolia to Typesense: Questions and Answers

Juan sought advice from Kishore Nallan about moving from Algolia to Typesense, handling MultiSearch, setting parameters, checking imported documents, and a specific syntax query.

1

22
22mo

Phrase Search Relevancy and Weights Fix

Jan reported an issue with phrase search relevancy using Typesense Instantsearch Adapter. The problem occurred when searching phrases with double quotes. The team identified the issue to be related to weights and implemented a fix, improving the search results.

6

111
8mo