Package org.hibernate.search
Interface SearchFactory
-
public interface SearchFactoryDeprecated.Instead of using Hibernate Search 5 APIs, get aSearchMappingusingSearch.mapping(javax.persistence.EntityManagerFactory), orSearch.mapping(SessionFactory). See the individual methods for the replacement of each method. Refer to the migration guide for more information.Provide application wide operations as well as access to the underlying Lucene resources.- Author:
- Emmanuel Bernard, Hardy Ferentschik, Sanne Grinovero
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description QueryContextBuilderbuildQueryBuilder()Deprecated.See the deprecation note onQueryBuilderfor predicates ("queries")SortContextfor sorts,FacetContextfor aggregations ("facets").AnalyzergetAnalyzer(Class<?> clazz)Deprecated.Instead of using Hibernate Search 5 APIs, get aSearchMappingusingSearch.mapping(javax.persistence.EntityManagerFactory), orSearch.mapping(SessionFactory), then get access to the entity metadata usingSearchMapping.indexedEntity(Class), then get the corresponding index usingSearchIndexedEntity.indexManager(), then convert it to aLuceneIndexManagerusingIndexManager.unwrap(Class), then get the analyzer usingLuceneIndexManager.searchAnalyzer().AnalyzergetAnalyzer(String name)Deprecated.Instead of using Hibernate Search 5 APIs, get aSearchMappingusingSearch.mapping(javax.persistence.EntityManagerFactory), orSearch.mapping(SessionFactory), then get access to the backend usingSearchMapping.backend(), then convert it to aLuceneBackendusingBackend.unwrap(Class), then get the analyzer usingLuceneBackend.analyzer(String).Set<Class<?>>getIndexedTypes()Deprecated.Instead of using Hibernate Search 5 APIs, get aSearchMappingusingSearch.mapping(javax.persistence.EntityManagerFactory), orSearch.mapping(SessionFactory), then get access to the entity metadata usingSearchMapping.allIndexedEntities().voidoptimize()Deprecated.Instead of using Hibernate Search 5 APIs, get aSearchScopeusingSearchSession.scope(Class)orSearchMapping.scope(Class), then aSearchWorkspaceusingSearchScope.workspace(), then callSearchWorkspace.mergeSegments()to "optimize" all indexes in scope.voidoptimize(Class<?> entityType)Deprecated.Instead of using Hibernate Search 5 APIs, get aSearchScopeusingSearchSession.scope(Class)orSearchMapping.scope(Class), then aSearchWorkspaceusingSearchScope.workspace(), then callSearchWorkspace.mergeSegments()to "optimize" all indexes in scope.<T> Tunwrap(Class<T> cls)Deprecated.Unwraps some internal Hibernate Search types.
-
-
-
Method Detail
-
optimize
@Deprecated void optimize()
Deprecated.Instead of using Hibernate Search 5 APIs, get aSearchScopeusingSearchSession.scope(Class)orSearchMapping.scope(Class), then aSearchWorkspaceusingSearchScope.workspace(), then callSearchWorkspace.mergeSegments()to "optimize" all indexes in scope.Optimize all indexes
-
optimize
@Deprecated void optimize(Class<?> entityType)
Deprecated.Instead of using Hibernate Search 5 APIs, get aSearchScopeusingSearchSession.scope(Class)orSearchMapping.scope(Class), then aSearchWorkspaceusingSearchScope.workspace(), then callSearchWorkspace.mergeSegments()to "optimize" all indexes in scope.Optimize the index holdingentityType- Parameters:
entityType- the entity type (index) to optimize
-
getAnalyzer
@Deprecated Analyzer getAnalyzer(String name)
Deprecated.Instead of using Hibernate Search 5 APIs, get aSearchMappingusingSearch.mapping(javax.persistence.EntityManagerFactory), orSearch.mapping(SessionFactory), then get access to the backend usingSearchMapping.backend(), then convert it to aLuceneBackendusingBackend.unwrap(Class), then get the analyzer usingLuceneBackend.analyzer(String). Refer to the migration guide for more information.Retrieve an analyzer instance by its definition name- Parameters:
name- the name of the analyzer- Returns:
- analyzer with the specified name
- Throws:
org.hibernate.search.util.common.SearchException- if the definition name is unknown
-
getAnalyzer
@Deprecated Analyzer getAnalyzer(Class<?> clazz)
Deprecated.Instead of using Hibernate Search 5 APIs, get aSearchMappingusingSearch.mapping(javax.persistence.EntityManagerFactory), orSearch.mapping(SessionFactory), then get access to the entity metadata usingSearchMapping.indexedEntity(Class), then get the corresponding index usingSearchIndexedEntity.indexManager(), then convert it to aLuceneIndexManagerusingIndexManager.unwrap(Class), then get the analyzer usingLuceneIndexManager.searchAnalyzer(). Refer to the migration guide for more information.Retrieves the scoped analyzer for a given class.- Parameters:
clazz- The class for which to retrieve the analyzer.- Returns:
- The scoped analyzer for the specified class.
- Throws:
IllegalArgumentException- in caseclazz == nullor the specified class is not an indexed entity.
-
buildQueryBuilder
@Deprecated QueryContextBuilder buildQueryBuilder()
Deprecated.See the deprecation note onQueryBuilderfor predicates ("queries")SortContextfor sorts,FacetContextfor aggregations ("facets").- Returns:
- return a query builder providing a fluent API to create Lucene queries
-
getIndexedTypes
@Deprecated Set<Class<?>> getIndexedTypes()
Deprecated.Instead of using Hibernate Search 5 APIs, get aSearchMappingusingSearch.mapping(javax.persistence.EntityManagerFactory), orSearch.mapping(SessionFactory), then get access to the entity metadata usingSearchMapping.allIndexedEntities().Returns the set of currently indexed types.- Returns:
- the set of currently indexed types. If no types are indexed the empty set is returned.
-
unwrap
<T> T unwrap(Class<T> cls)
Deprecated.Unwraps some internal Hibernate Search types. Currently, no public type is accessible. This method should not be used by users.- Type Parameters:
T- the type of the unwrapped class- Parameters:
cls- the type to unwrap- Returns:
- the unwrapped object
-
-