Interface SearchSession

All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
InfinispanSearchSession

public interface SearchSession extends AutoCloseable
Author:
Fabio Massimo Ercoli
  • Method Details

    • search

      <E> org.hibernate.search.engine.search.query.dsl.SearchQuerySelectStep<?,org.hibernate.search.engine.common.EntityReference,E,?,?,?> search(SearchScope<E> scope)
      Initiate the building of a search query.

      The query will target the indexes in the given scope.

      Type Parameters:
      E - An entity type to include in the scope.
      Parameters:
      scope - A scope representing all indexed types that will be targeted by the search query.
      Returns:
      The initial step of a DSL where the search query can be defined.
      See Also:
      • SearchQuerySelectStep
    • scope

      default <E> SearchScope<E> scope(Class<E> type)
      Create a SearchScope limited to the given type.
      Type Parameters:
      E - An entity type to include in the scope.
      Parameters:
      type - A type to include in the scope.
      Returns:
      The created scope.
      See Also:
    • scope

      <E> SearchScope<E> scope(Collection<? extends Class<? extends E>> types)
      Create a SearchScope limited to the given types.
      Type Parameters:
      E - A supertype of all indexed entity types that will be targeted by the search query.
      Parameters:
      types - A collection of types to include in the scope.
      Returns:
      The created scope.
      See Also:
    • scope

      default <T> SearchScope<T> scope(Class<T> expectedSuperType, String entityName)
      Create a SearchScope limited to entity types referenced by their name.
      Type Parameters:
      T - A supertype of all entity types to include in the scope.
      Parameters:
      expectedSuperType - A supertype of all entity types to include in the scope.
      entityName - An entity name.
      Returns:
      The created scope.
      See Also:
    • scope

      <T> SearchScope<T> scope(Class<T> expectedSuperType, Collection<String> entityNames)
      Create a SearchScope limited to entity types referenced by their name.
      Type Parameters:
      T - A supertype of all entity types to include in the scope.
      Parameters:
      expectedSuperType - A supertype of all entity types to include in the scope.
      entityNames - A collection of entity names.
      Returns:
      The created scope.
      See Also:
    • createIndexer

      org.hibernate.search.mapper.pojo.work.spi.PojoIndexer createIndexer()