searchBundle method
Future<KnowledgeBundleSearch>
searchBundle(
- ProjectBundle bundle,
- String query, {
- int limit = 5,
- KnowledgeMetadataFilter? filters,
- StaleIndexPolicy stale = StaleIndexPolicy.refuse,
- WayfinderCancellation? cancel,
Searches the saved index of one bundle, with its own context policy
rather than a project's shared ranking. stale and cancel are as for
search.
Implementation
Future<KnowledgeBundleSearch> searchBundle(
ProjectBundle bundle,
String query, {
int limit = 5,
KnowledgeMetadataFilter? filters,
StaleIndexPolicy stale = StaleIndexPolicy.refuse,
WayfinderCancellation? cancel,
}) => _admit(
limit: limit,
() => _encoding((acquire) async {
throwIfCancelled(cancel);
final found = await _searchIndex(
await _namespace(bundle),
query,
limit: limit,
filters: filters,
stale: stale,
cancel: cancel,
encoder: acquire,
);
return KnowledgeBundleSearch(
bundle,
found.response,
freshness: found.freshness,
);
}),
);