TableOperationsTSearchRecordsAsync Method

Locally searches retrieved table records after queried from database for the specified sorting and search parameters. Search executed against fields modeled with SearchableAttribute. Function only typically used for record models that apply the EncryptDataAttribute.

Definition

Namespace: Gemstone.Data.Model
Assembly: Gemstone.Data (in Gemstone.Data.dll) Version: 1.0.137 -- Release Build+bf396311d630d9a0959afedb17412b40a2acb327
public IAsyncEnumerable<T> SearchRecordsAsync(
	string? sortField,
	bool ascending,
	CancellationToken cancellationToken,
	StringComparison comparison = StringComparison.OrdinalIgnoreCase,
	params IRecordFilter?[]? recordFilters
)

Parameters

sortField  String
Field name to order-by.
ascending  Boolean
Sort ascending flag; set to false for descending.
cancellationToken  CancellationToken
Propagates notification that operations should be canceled.
comparison  StringComparison  (Optional)
StringComparison to use when searching string fields; defaults to ordinal ignore case.
recordFilters  IRecordFilter
Record Filters to be applied.

Return Value

IAsyncEnumerableT
An array of modeled table row instances for the queried records that match the search.

Remarks

This function searches records locally after query from database, this way Search functionality will work even with fields that are modeled with the EncryptDataAttribute and use restrictions not being = or =/=. Primary keys for this function will not be cached server-side and this function will be slower and more expensive than similar calls to QueryRecords(String, Boolean, Int32, Int32, IRecordFilter). Usage should be restricted to cases searching for field data that has been modeled with the EncryptDataAttribute.

This function does not paginate records, instead a full list of search records is returned. User can cache returned records and page through them using the GetPageOfRecordsAsync(IAsyncEnumerableT, Int32, Int32) function. As a result, usage should be restricted to smaller data sets.

See Also