Yoann Rodière (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *commented* on HSEARCH-1383 (
https://hibernate.atlassian.net/browse/HSEARCH-1383?atlOrigin=eyJpIjoiYTU...
)
Re: Ability to disable automatic indexing programmatically at the session level (
https://hibernate.atlassian.net/browse/HSEARCH-1383?atlOrigin=eyJpIjoiYTU...
)
Note the problem described in the issue description:
At the end of the transaction, however, the indexer tries to load the
status and status texts that are referenced by the articles, which due to
the flush and clear operations results in lazy initialization exceptions
(the articles that are to be indexed are not attached to the session
anymore).
… is no longer relevant in Hibernate Search 6:
https://docs.jboss.org/hibernate/stable/search/reference/en-US/html_singl...
(
https://docs.jboss.org/hibernate/stable/search/reference/en-US/html_singl...
)
With Hibernate Search 6 (on contrary to Hibernate Search 5 and earlier),
this pattern will work as expected:
* with coordination disabled (
https://docs.jboss.org/hibernate/stable/search/reference/en-US/html_singl...
) (the default), documents will be built on flushes, and sent to the index
upon transaction commit.
* with outbox-polling coordination (
https://docs.jboss.org/hibernate/stable/search/reference/en-US/html_singl...
) , entity change events will be persisted on flushes, and committed along
with the rest of the changes upon transaction commit.
The use case remains, though: when someone uses a session for bulk imports, they will
probably want to disable automatic indexing in that session and perform mass indexing
later.
(
https://hibernate.atlassian.net/browse/HSEARCH-1383#add-comment?atlOrigin...
) Add Comment (
https://hibernate.atlassian.net/browse/HSEARCH-1383#add-comment?atlOrigin...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100217- sha1:2199b34 )