[hibernate-issues] [JIRA] (HSEARCH-3900) drop-and-create strategy is not working at app. startup when "hibernate.search.autoregister_listeners" is set to false. And if true, startup index creation thread are not released.

Ronak S (JIRA) jira at hibernate.atlassian.net
Sun Apr 26 07:35:19 EDT 2020


Ronak S ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5ea56c8496bbcb0b852580f0 ) *created* an issue

Hibernate Search ( https://hibernate.atlassian.net/browse/HSEARCH?atlOrigin=eyJpIjoiNGEyNTI0OGFkNjJiNDUzYmIyNjRkZGU0NTkxNTY1MGMiLCJwIjoiaiJ9 ) / Bug ( https://hibernate.atlassian.net/browse/HSEARCH-3900?atlOrigin=eyJpIjoiNGEyNTI0OGFkNjJiNDUzYmIyNjRkZGU0NTkxNTY1MGMiLCJwIjoiaiJ9 ) HSEARCH-3900 ( https://hibernate.atlassian.net/browse/HSEARCH-3900?atlOrigin=eyJpIjoiNGEyNTI0OGFkNjJiNDUzYmIyNjRkZGU0NTkxNTY1MGMiLCJwIjoiaiJ9 ) drop-and-create strategy is not working at app. startup when "hibernate.search.autoregister_listeners" is set to false. And if true, startup index creation thread are not released. ( https://hibernate.atlassian.net/browse/HSEARCH-3900?atlOrigin=eyJpIjoiNGEyNTI0OGFkNjJiNDUzYmIyNjRkZGU0NTkxNTY1MGMiLCJwIjoiaiJ9 )

Issue Type: Bug Affects Versions: 5.11.5.Final Assignee: Sanne Grinovero ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A690dd548-c602-4a58-9c7e-0923346f4e97 ) Components: backend-lucene Created: 26/Apr/2020 04:35 AM Environment: Hibernate 5.4.12, Hibernate search 5.11.5 Labels: hibernate performance Priority: Critical Reporter: Ronak S ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5ea56c8496bbcb0b852580f0 )

We have upgraded our system hibernate to 5.4.12 and hibernate search ORM to 5.11.5 with app server Websphere 8.5.5.16. We are using Elastic Search 5.6.10.

*Issue:*
On initial startup we saw lots of threads been created for refreshing the indexes on elastic side. But we do not want this to happen, we searched and found out the property to stop this and that was "hibernate.search.autoregister_listeners". Setting this property to false, stopped creation of all these index refreshing threads.
But now we had other issue. Now we were unable to perform the dropping and creation of indexes at server startup. By using "hibernate.search.default.elasticsearch.index_schema_management_strategy" as drop-and-create. Due to the setting of "hibernate.search.autoregister_listeners" to false, this does not works anymore.

So the question arises, why in the first place we introduced this property("hibernate.search.autoregister_listeners"), answer to that we got on the official documentation side and that reads:

"The good news is that Hibernate Search is enabled out of the box when detected on the classpath by Hibernate ORM. If for some reason you need to disable it set hibernate.search.autoregister_listeners to false. Note that there is no performance penalty when the listeners are enabled but no entities are annotated as indexed."

But what if we have the entities as @Indexed, this fails.

If we have hibernate.search.autoregister_listeners settings as false then while executing fullTextEntityManager.createIndexer().startAndWait() am receiving org.hibernate.search.exception.SearchException: HSEARCH000222: The SearchFactory was not initialized. Why do I suspect the whole meaning of hibernate search ORM usage under a hibernate project is lost with this new version. If hibernate.search.autoregister_listeners is false I can not use the hibernate search at all and if its true than I've the performance issue at startup.

We strongly feel this to be a bug in new version as this functionality of drop-and-create and the mass indexer was working as expected under the older versions without this new property. Though we are sure Hibernate community must have provided this with a thought.
But again this is not working as expected keeping the other functionalities of hibernate search in mind.

*hibernate.cfg.xml*

<property name= "hibernate.search.autoregister_listeners" > true </property>
<property name= "hibernate.search. default.indexmanager" >elasticsearch</property>
<property name= "hibernate.search. default.elasticsearch.host" >http: //ip:9400</property>
<property name= "hibernate.search. default.elasticsearch.index_schema_management_strategy" >drop-and-create</property>
<property name= "hibernate.search. default.elasticsearch.required_index_status" >yellow</property>
<property name= "hibernate.search. default.indexwriter.infostream" > true </property>

Please look into this and share your thoughts.

( https://hibernate.atlassian.net/browse/HSEARCH-3900#add-comment?atlOrigin=eyJpIjoiNGEyNTI0OGFkNjJiNDUzYmIyNjRkZGU0NTkxNTY1MGMiLCJwIjoiaiJ9 ) Add Comment ( https://hibernate.atlassian.net/browse/HSEARCH-3900#add-comment?atlOrigin=eyJpIjoiNGEyNTI0OGFkNjJiNDUzYmIyNjRkZGU0NTkxNTY1MGMiLCJwIjoiaiJ9 )

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.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8 ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100125- sha1:84eb093 )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hibernate-issues/attachments/20200426/d1029163/attachment.html 


More information about the hibernate-issues mailing list