Resolving Typesense Document Mapping Error in Flutter
TLDR Rude had issues mapping a typesense document into a dart object due to a 'Map' type error. Harpreet suggested a change in the map syntax which solved the problem.
Jul 11, 2022 (14 months ago)
Rude
03:36 PMfinal hits = (a['hits'] as List)
.cast<Map>()
.map((e) => UserSearchable(name: e['document'] as Map['name'] as String, id:e['document'] as Map['id'] as String, imageUrls: e['document'] as Map['imageUrls'] as List<String>))
.toList();
but it throws an error saying "The argument type 'Map<dynamic, dynamic>' can't be assigned to the parameter type 'String'". Anyone deal with something similar?
Jason
03:44 PMHarpreet
06:05 PMIs this causing the issue?
name: e['document'] as Map['name'] as String
if so, can you try
name: (e['document'] as Map)['name'] as String
Harpreet
06:15 PMe['document']['name"]
should suffice
Jul 12, 2022 (14 months ago)
Rude
05:11 PMTypesense
Indexed 2764 threads (79% resolved)
Similar Threads
Resolving Issues with Firebase Extension and Typesense Configuration
Ernie sought clarification on how to handle the Firebase Extension and typesense collection configuration issues. Jason explained how to correctly specify the path and refresh the page to see updated data. After applying the advice given, Ernie successfully saw the changes.


Trouble Spotting API Error in Dart vs Shell Operations
Erick is having issues with the typesense API, receiving errors in Dart that are not present in shell operations. Despite Kishore Nallan trying to help, no solution has been found, leading Erick to post the issue on the dart client repository.
Handling Search Limitations and Results Parsing in Typesense
Loic faced difficulties with Typesense search result limits and parsing results in Dart. Jason advised using the export endpoint to avoid limits and splitting the JSONL formatted result string by newline for parsing.