Skip to main content

Searching

Global search is separate from field filtering. It is designed for user-facing search boxes that search text across one or more compatible dataset fields.

await dataSet.search.apply('Seattle');

By default the search uses phrase mode and is case-insensitive.

Restrict the field scope

await dataSet.search.apply(
'smith',
fields: ['code', 'name', 'city'],
);

Explicit field scopes make search behavior predictable and can reduce backend query work for adapter-backed datasets.

Search mode and case sensitivity

await dataSet.search.apply(
'ACME',
mode: FdcSearchMode.phrase,
caseSensitive: true,
);

Inspect and clear search state

final active = dataSet.search.active;
final state = dataSet.search.state;

await dataSet.search.clear();

The active search state belongs to the dataset view and composes with filtering and sorting.

Local datasets evaluate search against the in-memory view. Adapter-backed paging routes search through the adapter query path so results are searched before paging is applied.

Search capabilities depend on adapter implementation and backend query semantics. Document backend-specific behavior in the corresponding adapter guide.