Search 6 groundwork - Rename Search.getSearchSession(Session) to Search.session(Session)

Description

This:

1 2 3 SearchResult<Book> result = Search.getSearchSession(em).search(Book.class) .predicate(f -> f.matchAll()) .fetch(20, 0);

will become this:

1 2 3 SearchResult<Book> result = Search.session(em).search(Book.class) .predicate(f -> f.matchAll()) .fetch(20, 0);

... which is shorter but also will allow, one day, to have extra methods in Search such as this:

1 2 3 4 5 6 7 8 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);

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.

Environment

None

Status

Assignee

Yoann Rodière

Reporter

Yoann Rodière

Labels

None

Suitable for new contributors

None

Feedback Requested

None

Components

Fix versions

Priority

Major
Configure