-
Interfaces Interface Description org.hibernate.search.FullTextQuery Instead of using Hibernate Search 5 APIs, get aSearchSessionusingSearch.session(Session), then create aSearchQuerywithSearchSession.search(Class). If you really need an adapter to Hibernate ORM'sQuerytype, convert thatSearchQueryusingSearch.toOrmQuery(SearchQuery), but be aware that only part of the contract is implemented. Refer to the migration guide for more information.org.hibernate.search.FullTextSession Instead of using Hibernate Search 5 APIs, get aSearchSessionusingSearch.session(Session). Refer to the migration guide for more information.org.hibernate.search.FullTextSharedSessionBuilder Will be removed without replacement, as Hibernate Search sessions (SearchSession) no longer extend JPA'sEntityManagerinterface or Hibernate ORM'sSession. To get access to a Hibernate Search 6 session, useSearch.session(Session).org.hibernate.search.jpa.FullTextEntityManager Instead of using Hibernate Search 5 APIs, get aSearchSessionusingSearch.session(EntityManager). Refer to the migration guide for more information.org.hibernate.search.jpa.FullTextQuery Instead of using Hibernate Search 5 APIs, get aSearchSessionusingSearch.session(EntityManager), then create aSearchQuerywithSearchSession.search(Class). If you really need an adapter to JPA'sQuery, convert thatSearchQueryusingSearch.toJpaQuery(SearchQuery), but be aware that only part of the contract is implemented. Refer to the migration guide for more information.org.hibernate.search.MassIndexer Instead of using Hibernate Search 5 APIs, get aSearchSessionusingSearch.session(Session), then create a mass indexer withSearchSession.massIndexer(Class[]). Refer to the migration guide for more information.org.hibernate.search.SearchFactory 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.
-
Classes Class Description org.hibernate.search.jpa.Search UseSearchinstead.org.hibernate.search.Search UseSearchinstead.
-
Methods Method Description org.hibernate.search.FullTextQuery.setFetchSize(int) Instead of using Hibernate Search 5 APIs, get aSearchSessionusingSearch.session(EntityManager), create a search query withSearchSession.search(Class), and define your loading options usingSearchQueryOptionsStep.loading(Consumer). To set the equivalent toFullTextQuery.setFetchSize(int)in Hibernate Search 6, useSearchLoadingOptionsStep.fetchSize(int). Refer to the migration guide for more information.org.hibernate.search.FullTextQuery.setResultTransformer(ResultTransformer) Instead of using Hibernate Search 5 APIs, get aSearchSessionusingSearch.session(Session), create a search query withSearchSession.search(Class), and define your projections usingSearchQuerySelectStep.select(Function). See in particular the composite projection, which allows applying a function to another projection:SearchProjectionFactory.composite(Function, ProjectionFinalStep). Refer to the migration guide for more information.org.hibernate.search.FullTextSharedSessionBuilder.autoClose(boolean) org.hibernate.search.FullTextSharedSessionBuilder.connectionReleaseMode() org.hibernate.search.FullTextSharedSessionBuilder.flushBeforeCompletion() org.hibernate.search.FullTextSharedSessionBuilder.transactionContext() org.hibernate.search.jpa.FullTextEntityManager.createFullTextQuery(Query, Class<?>...) Instead of using Hibernate Search 5 APIs, get aSearchSessionusingSearch.session(EntityManager), then create aSearchQuerywithSearchSession.search(Class). If you really need an adapter to Hibernate ORM'sQuerytype, convert thatSearchQueryusingSearch.toOrmQuery(SearchQuery), but be aware that only part of the contract is implemented. Refer to the migration guide for more information.org.hibernate.search.jpa.FullTextEntityManager.createIndexer(Class<?>...) Instead of using Hibernate Search 5 APIs, get aSearchSessionusingSearch.session(Session), then create a mass indexer withSearchSession.massIndexer(Class[]). Refer to the migration guide for more information.org.hibernate.search.jpa.FullTextEntityManager.flushToIndexes() Instead of using Hibernate Search 5 APIs, get aSearchSessionusingSearch.session(EntityManager), then get the indexing plan for that session usingSearchSession.indexingPlan(), then force the immediate execution of indexing operations usingSearchIndexingPlan.execute().org.hibernate.search.jpa.FullTextEntityManager.getSearchFactory() See the deprecation note onSearchFactory.org.hibernate.search.jpa.FullTextEntityManager.index(T) Instead of using Hibernate Search 5 APIs, get aSearchSessionusingSearch.session(EntityManager), then get the indexing plan for that session usingSearchSession.indexingPlan(), then add/update/remove entities to/from the index usingSearchIndexingPlan.addOrUpdate(Object),SearchIndexingPlan.delete(Object), orSearchIndexingPlan.purge(Class, Object, String).org.hibernate.search.jpa.FullTextEntityManager.purge(Class<T>, Serializable) To purge all instances of a given type, see the deprecation note onFullTextEntityManager.purgeAll(Class). To purge a specific instance, instead of using Hibernate Search 5 APIs, get aSearchSessionusingSearch.session(EntityManager), then get the indexing plan for that session usingSearchSession.indexingPlan(), then add/update/remove entities to/from the index usingSearchIndexingPlan.addOrUpdate(Object),SearchIndexingPlan.delete(Object), orSearchIndexingPlan.purge(Class, Object, String).org.hibernate.search.jpa.FullTextEntityManager.purgeAll(Class<T>) Instead of using Hibernate Search 5 APIs, get aSearchScopeusingSearchSession.scope(Class)orSearchMapping.scope(Class), then aSearchWorkspaceusingSearchScope.workspace(), then callSearchWorkspace.purge()to purge all indexes in scope.org.hibernate.search.jpa.FullTextQuery.explain(Object) Instead of using Hibernate Search 5 APIs, get aSearchSessionusingSearch.session(EntityManager), create a search query withSearchSession.search(Class), convert it to aLuceneSearchQueryby passingLuceneExtension.get()toSearchQuery.extension(SearchQueryExtension), and get the explanation usingLuceneSearchQuery.explain(Object). Note theexplainmethods now expect an entity ID, not the internal Lucene docId. Refer to the migration guide for more information.org.hibernate.search.jpa.FullTextQuery.getFacetManager() Instead of using Hibernate Search 5 APIs, get aSearchSessionusingSearch.session(EntityManager), create a search query withSearchSession.search(Class), and define your facets (now called aggregations) usingSearchQueryOptionsStep.aggregation(AggregationKey, Function). You can then fetch the query result usingSearchFetchable.fetch(Integer)and get each aggregation usingSearchResult.aggregation(AggregationKey). Refer to the migration guide for more information.org.hibernate.search.jpa.FullTextQuery.getResultSize() Instead of using Hibernate Search 5 APIs, get aSearchSessionusingSearch.session(EntityManager), create a search query withSearchSession.search(Class), and get the total hit count ("result size") usingSearchFetchable.fetchTotalHitCount(). Refer to the migration guide for more information.org.hibernate.search.jpa.FullTextQuery.hasPartialResults() Instead of using Hibernate Search 5 APIs, get aSearchSessionusingSearch.session(EntityManager), create a search query withSearchSession.search(Class), set a "truncation" timeout usingSearchQueryOptionsStep.truncateAfter(long, TimeUnit), and get theSearchResultwithSearchFetchable.fetch(Integer). You'll be able to check whether the result is partial or not usingSearchResult.timedOut(). Refer to the migration guide for more information.org.hibernate.search.jpa.FullTextQuery.initializeObjectsWith(ObjectLookupMethod, DatabaseRetrievalMethod) Instead of using Hibernate Search 5 APIs, get aSearchSessionusingSearch.session(EntityManager), create a search query withSearchSession.search(Class), and define your loading options usingSearchQueryOptionsStep.loading(Consumer). To set the equivalent toObjectLookupMethodin Hibernate Search 6, useSearchLoadingOptionsStep.cacheLookupStrategy(EntityLoadingCacheLookupStrategy). Refer to the migration guide for more information.org.hibernate.search.jpa.FullTextQuery.limitExecutionTimeTo(long, TimeUnit) Instead of using Hibernate Search 5 APIs, get aSearchSessionusingSearch.session(EntityManager), create a search query withSearchSession.search(Class), set a "truncation" timeout usingSearchQueryOptionsStep.truncateAfter(long, TimeUnit), and get theSearchResultwithSearchFetchable.fetch(Integer). You'll be able to check whether the result is partial or not usingSearchResult.timedOut(). Refer to the migration guide for more information.org.hibernate.search.jpa.FullTextQuery.setFirstResult(int) Instead of using Hibernate Search 5 APIs, get aSearchSessionusingSearch.session(EntityManager), create a search query withSearchSession.search(Class), and pass the hit offset ("firstResult") when fetching results usingSearchFetchable.fetch(Integer),SearchFetchable.fetch(Integer, Integer),SearchFetchable.fetchHits(Integer)orSearchFetchable.fetch(Integer, Integer).org.hibernate.search.jpa.FullTextQuery.setMaxResults(int) Instead of using Hibernate Search 5 APIs, get aSearchSessionusingSearch.session(EntityManager), create a search query withSearchSession.search(Class), and pass the hit limit ("maxResults") when fetching results usingSearchFetchable.fetch(Integer),SearchFetchable.fetch(Integer, Integer),SearchFetchable.fetchHits(Integer)orSearchFetchable.fetch(Integer, Integer).org.hibernate.search.jpa.FullTextQuery.setProjection(String...) Instead of using Hibernate Search 5 APIs, get aSearchSessionusingSearch.session(EntityManager), create a search query withSearchSession.search(Class), and define your projections usingSearchQuerySelectStep.select(Function). Refer to the migration guide for more information.org.hibernate.search.jpa.FullTextQuery.setResultTransformer(ResultTransformer) Instead of using Hibernate Search 5 APIs, get aSearchSessionusingSearch.session(EntityManager), create a search query withSearchSession.search(Class), and define your projections usingSearchQuerySelectStep.select(Function). See in particular the composite projection, which allows applying a function to another projection:SearchProjectionFactory.composite(Function, ProjectionFinalStep). Refer to the migration guide for more information.org.hibernate.search.jpa.FullTextQuery.setSort(Sort) Instead of using Hibernate Search 5 APIs, get aSearchSessionusingSearch.session(EntityManager), create a search query withSearchSession.search(Class), and define your sorts usingSearchQueryOptionsStep.sort(Function). Refer to the migration guide for more information.org.hibernate.search.jpa.FullTextQuery.setSpatialParameters(double, double, String) Instead of using Hibernate Search 5 APIs, get aSearchSessionusingSearch.session(EntityManager), create a search query withSearchSession.search(Class), and define your projections usingSearchQuerySelectStep.select(Function). See in particular the distance projection:SearchProjectionFactory.distance(String, GeoPoint). Refer to the migration guide for more information.org.hibernate.search.jpa.FullTextQuery.setTimeout(long, TimeUnit) Instead of using Hibernate Search 5 APIs, get aSearchSessionusingSearch.session(EntityManager), create a search query withSearchSession.search(Class), and set a "failure" timeout usingSearchQueryOptionsStep.failAfter(long, TimeUnit). Refer to the migration guide for more information.org.hibernate.search.jpa.Search.getFullTextEntityManager(EntityManager) UseSearch.session(EntityManager)instead.org.hibernate.search.MassIndexer.threadsForSubsequentFetching(int) Being ignored: this method will be removed.org.hibernate.search.Search.getFullTextSession(Session) UseSearch.session(Session)instead.org.hibernate.search.SearchFactory.buildQueryBuilder() See the deprecation note onQueryBuilderfor predicates ("queries")SortContextfor sorts,FacetContextfor aggregations ("facets").org.hibernate.search.SearchFactory.getAnalyzer(String) 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.org.hibernate.search.SearchFactory.getIndexedTypes() 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().org.hibernate.search.SearchFactory.optimize() 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.