This:
{code} SearchResult<Book> result = Search.getSearchSession(em).search(Book.class) .predicate(f -> f.matchAll()) .fetch(20, 0); {code}
will become this:
{code} SearchResult<Book> result = Search.session(em).search(Book.class) .predicate(f -> f.matchAll()) .fetch(20, 0); {code}
... which is shorted, shorter but also will allow, one day, to have extra methods in Search such as this:
{code} MassIndexer massIndexer = Search.massIndexer(entityManagerFactory, Book.class); MassIndexer massIndexer = Search.massIndexer(entityManagerFactory, tenantId, Book.class); MassIndexer massIndexer = Search.massIndexer(entityManagerFactory, tenantId, Book.class, Author.class);
// For session-less operations such as purge... maybe? SearchWriter writer = Search.writer(entityManagerFactory, Book.class); SearchWriter writer = Search.writer(entityManagerFactory, tenantId, Book.class); SearchWriter writer = Search.writer(entityManagerFactory, tenantId, Book.class, Author.class); {code}
Keep {{Search.getSearchSession()}} for now, but implement it as a redirection to {{Search.session()}}, and deprecate it.
Be sure to replace every use of {{Search.getSearchSession()}} in our code with the new syntax. |
|