searchWithCount abstract method

Future<SearchResult> searchWithCount(
  1. SearchCriteria criteria,
  2. DbPrincipal principal, {
  3. SearchPolicy? searchPolicy,
  4. RepositoryTransaction? transaction,
})

Searches entities according to criteria, returning a page of entities and the count of total entities that fit the given constraints.

Implementations should filter the search results limiting them to entities belonging to the tenant of the principal.

By default, this method will search all entities in the collection owned by the principal, except when the permission parameter is given. When the permission parameter has a non-empty argument and the user identified by the principal has that permission, then all the entities in the collection belonging to the tenant within the criteria defined by the criteria, regardless of their owner within the tenant.

Implementation

Future<SearchResult> searchWithCount(
  SearchCriteria criteria,
  DbPrincipal principal, {
  SearchPolicy? searchPolicy,
  RepositoryTransaction? transaction,
});