def shouldReturnEmptyResult()

in backend/app/controllers/api/Search.scala [118:142]


  def shouldReturnEmptyResult(proposedParams: SearchParameters, verifiedParams: SearchParameters, context: SearchContext): Boolean = {
    context match {
      case WorkspaceFolderSearchContext(blobUris) =>
        blobUris.isEmpty

      case DefaultSearchContext(visibleCollections, visibleWorkspaces) =>
        val cannotSeeAnyWorkspacesRequestedAndHasNoIngestionFilters =
          proposedParams.workspaceFilters.nonEmpty &&
            verifiedParams.workspaceFilters.isEmpty &&
            verifiedParams.ingestionFilters.isEmpty

        val cannotSeeAnyCollectionsRequestedAndHasNoWorkspaceFilters =
          proposedParams.ingestionFilters.nonEmpty &&
            verifiedParams.ingestionFilters.isEmpty &&
            verifiedParams.workspaceFilters.isEmpty

        val cannotSeeAnythingAtAll =
          visibleWorkspaces.isEmpty &&
          visibleCollections.isEmpty

        cannotSeeAnyWorkspacesRequestedAndHasNoIngestionFilters ||
          cannotSeeAnyCollectionsRequestedAndHasNoWorkspaceFilters ||
          cannotSeeAnythingAtAll
    }
  }