Interface TypedSearchScope<SR,E>

Type Parameters:
E - A supertype of all types in this scope.
All Superinterfaces:
SearchScope<E>

public interface TypedSearchScope<SR,E> extends SearchScope<E>
Represents a set of types and the corresponding indexes.

The scope can be used for search, to build search-related objects (predicate, sort, projection, aggregation, ...), or to define the targeted entities/indexes when passing it to the session.

It can also be used to start large-scale operations, e.g. using a SearchScope.schemaManager(), a SearchScope.workspace() or a SearchScope.massIndexer().

  • Method Details

    • 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.

      Specified by:
      predicate in interface SearchScope<SR>
      Returns:
      A predicate factory.
      See Also:
    • 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.

      Specified by:
      sort in interface SearchScope<SR>
      Returns:
      A sort factory.
      See Also:
    • 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.

      Specified by:
      projection in interface SearchScope<SR>
      Returns:
      A projection factory.
      See Also:
    • aggregation

      Initiate the building of a search aggregation that will be valid for the indexes in this scope.

      The aggregation will only be usable in 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 SearchQueryOptionsStep.aggregation(AggregationKey, SearchAggregation) define aggregations with lambdas} within the search query DSL, removing the need to create separate objects to represent the aggregation.

      Specified by:
      aggregation in interface SearchScope<SR>
      Returns:
      An aggregation factory.
      See Also:
    • extension

      <T> T extension(IndexScopeExtension<T> extension)
      Extend the current search scope with the given extension, resulting in an extended search scope offering backend-specific utilities.
      Specified by:
      extension in interface SearchScope<SR>
      Type Parameters:
      T - The type of search scope provided by the extension.
      Parameters:
      extension - The extension to apply.
      Returns:
      The extended search scope.
      Throws:
      SearchException - If the extension cannot be applied (wrong underlying technology, ...).