Interface SearchScope<E>

  • Type Parameters:
    E - A supertype of all types in this scope.

    public interface SearchScope<E>
    Represents a set of types and the corresponding indexes, allowing to build search-related objects (query, predicate, ...) taking into account the relevant indexes and their metadata (underlying technology, field types, ...).
    • Method Detail

      • predicate

        SearchPredicateFactory predicate()
        Initiate the building of a search predicate.

        The predicate will only be valid for search queries created using this scope or another scope instance targeting the same indexes.

        Note this method is only necessary if you do not want to use lambda expressions, since you can define predicates with lambdas within the search query DSL, removing the need to create separate objects to represent the predicates.

        Returns:
        A predicate factory.
        See Also:
        SearchPredicateFactory
      • sort

        SearchSortFactory sort()
        Initiate the building of a search sort.

        The sort will only be valid for search queries created using this scope or another scope instance targeting the same indexes. or a wider scope.

        Note this method is only necessary if you do not want to use lambda expressions, since you can define sorts with lambdas within the search query DSL, removing the need to create separate objects to represent the sorts.

        Returns:
        A sort factory.
        See Also:
        SearchSortFactory
      • projection

        SearchProjectionFactory<EntityReference,​E> projection()
        Initiate the building of a search projection that will be valid for the indexes in this scope.

        The projection will only be valid for search queries created using this scope or another scope instance targeting the same indexes.

        Note this method is only necessary if you do not want to use lambda expressions, since you can SearchQuerySelectStep.select(Function) define projections with lambdas} within the search query DSL, removing the need to create separate objects to represent the projections.

        Returns:
        A projection factory.
        See Also:
        SearchProjectionFactory
      • workspace

        SearchWorkspace workspace​(String tenantId)
        Create a SearchWorkspace for the indexes mapped to types in this scope, or to any of their sub-types.

        This method only works for multi-tenant applications. If multi-tenancy is disabled, use workspace() instead.

        Parameters:
        tenantId - The identifier of the tenant whose index content should be targeted.
        Returns:
        A SearchWorkspace.
      • massIndexer

        MassIndexer massIndexer()
        Create a MassIndexer for the indexes mapped to types in this scope, or to any of their sub-types.

        This method only works for single-tenant applications. If multi-tenancy is enabled, use massIndexer(String) instead.

        MassIndexer instances cannot be reused.

        Returns:
        A MassIndexer.
      • massIndexer

        MassIndexer massIndexer​(String tenantId)
        Create a MassIndexer for the indexes mapped to types in this scope, or to any of their sub-types.

        This method only works for multi-tenant applications. If multi-tenancy is disabled, use massIndexer() instead.

        MassIndexer instances cannot be reused.

        Parameters:
        tenantId - The identifier of the tenant whose index content should be targeted.
        Returns:
        A MassIndexer.