Skip to content

Commit 83fe245

Browse files
authored
Use the JSON-serialized SearchRequestData for request-passing to the search isolate. (#8896)
1 parent 59af9a0 commit 83fe245

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

app/lib/service/entrypoint/search_index.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ Future<void> main(List<String> args, var message) async {
6060
final info = await searchIndex.indexInfo();
6161
return ReplyMessage.result(info.toJson());
6262
} else if (payload is String) {
63-
final q = ServiceSearchQuery.fromServiceUrl(Uri.parse(payload));
63+
final q = ServiceSearchQuery.fromSearchRequestData(
64+
SearchRequestData.fromJson(
65+
json.decode(payload) as Map<String, dynamic>));
6466
final rs = await searchIndex.search(q);
6567
return ReplyMessage.result(json.encode(rs.toJson()));
6668
} else {
@@ -131,7 +133,7 @@ class IsolateSearchIndex implements SearchIndex {
131133
FutureOr<PackageSearchResult> search(ServiceSearchQuery query) async {
132134
try {
133135
final rs = await _runner.sendRequest(
134-
Uri(queryParameters: query.toUriQueryParameters()).toString(),
136+
json.encode(query.toSearchRequestData().toJson()),
135137
timeout: Duration(minutes: 1),
136138
);
137139
return PackageSearchResult.fromJson(

0 commit comments

Comments
 (0)