Overcoming Query String Error with Multi-Search in Flutter
TLDR Andrew was getting a query string error and tried to switch to multi-search. Jason helped them implement it correctly, clarifying the differences between single and multi-search, and confirmed that the multi-search is unbounded.
1
Nov 02, 2022 (14 months ago)
Andrew
09:48 PM"Query string exceeds max allowed length of 4000. Use the /multi_search end-point for larger payloads."
How would i get around this? Im using flutter so i dont know if i need to change the search function. For reference, that function looks like:
Future<Map<String, dynamic>> search(
Map<String, dynamic> searchParameters) async {
return await _apicall.get(
'$_endPoint/search',
queryParams: searchParameters,
shouldCacheResult: true,
);
}
Will changing /search to /multiSearch work?
Jason
09:52 PMAndrew
09:57 PMFuture<Map<String, dynamic>> multiSearch(
Map<String, dynamic> searchParameters) async {
return await _apicall.get(
'$_endPoint/multi_search',
queryParams: searchParameters,
shouldCacheResult: true,
);
}
Inside of documents.dart, but when i try to call the method, i get
Error: The method 'multiSearch' isn't defined for the class 'Documents'.
lib/…
- 'Documents' is from 'package:typesense/src...').
package:typesense/src/documents.dart:1
Try correcting the name to the name of an existing method, or defining a method named 'multiSearch'.
await _typesenseClient.collection('users').documents.multiSearch({
^^^^^^^^^^^
Any idea why this doesnt work?
Jason
10:09 PMAndrew
10:45 PMJason
11:00 PMAndrew
11:55 PMAndrew
11:55 PMNov 03, 2022 (14 months ago)
Jason
12:24 AM1
Typesense
Indexed 3015 threads (79% resolved)
Similar Threads
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.
Understanding and Implementing Typesense Dart Library with Flutter
Alexandro sought help with the Typesense Dart library. Jason explained that the library is in progress, discussed utilizing other HTTP libraries, and provided detailed instructions on utilizing Typesense with Flutter. Alexandro provided feedback on the Typesense UI and expressed interest in creating a tutorial video.
Discussion on the Use of `TypesenseInstantSearchAdapter`
DavidLo sought advice to retrieve search results using `TypesenseInstantSearchAdapter`. Carl and Jason advised using `typesense-js` and features like `documents/export`, `documents/search`, `multisearch`, and pagination. The potential server-side solution and bundle size issues concerning the exposure of the search client were also discussed.
Multiple Filters and JSON Requests in Typesense
Manish asked about multiple filter_by arguments, JSON input, and using multisearch. Jason offered typesense documentation links, examples, and how to use JSON formatted requests with multisearch. Ed shared a similar use case.
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.