<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> 
    <head> 
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"> 
        <base href="https://hibernate.atlassian.net"> 
        <title>Message Title</title> 
    </head> 
    <body class="jira" style="color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 1.429"> 
        <table id="background-table" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0; mso-table-rspace: 0; background-color: #f5f5f5; border-collapse: collapse; mso-table-lspace: 0; mso-table-rspace: 0" bgcolor="#f5f5f5"> <!-- header here --> 
            <tbody>
                <tr> 
                    <td id="header-pattern-container" style="padding: 0; border-collapse: collapse; padding: 10px 20px"> 
                        <table id="header-pattern" cellspacing="0" cellpadding="0" border="0" style="border-collapse: collapse; mso-table-lspace: 0; mso-table-rspace: 0"> 
                            <tbody>
                                <tr> 
                                    <td id="header-avatar-image-container" valign="top" style="padding: 0; border-collapse: collapse; vertical-align: top; width: 32px; padding-right: 8px" width="32"> <img id="header-avatar-image" class="image_fix" src="https://secure.gravatar.com/avatar/778f91b6f033ccf5b2ba9910d4a8b6a2?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FRS-0.png&amp;size=48&amp;s=48" height="32" width="32" border="0" style="border-radius: 3px; vertical-align: top"> </td> 
                                    <td id="header-text-container" valign="middle" style="padding: 0; border-collapse: collapse; vertical-align: middle; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 1px"> <a class="user-hover" rel="ronaks" style="color:#6c797f;; color: #3b73af; text-decoration: none" id="email_ronaks" href="https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5ea56c8496bbcb0b852580f0"> Ronak S </a> <strong>commented</strong> on <a href="https://hibernate.atlassian.net/browse/HSEARCH-3900?atlOrigin=eyJpIjoiMmY4NTYxZjQ2Njk3NDFiYTkwNDM2YTQ5YzAzNTNjMTIiLCJwIjoiaiJ9" style="color: #3b73af; text-decoration: none"><img src="cid:jira-generated-image-avatar-24d2862d-c00f-4cbe-97d7-e995c9a178b0" height="16" width="16" border="0" align="absmiddle" alt="Bug"> HSEARCH-3900</a> </td> 
                                </tr> 
                            </tbody>
                        </table> </td> 
                </tr> 
                <tr> 
                    <td id="email-content-container" style="padding: 0; border-collapse: collapse; padding: 0 20px"> 
                        <table id="email-content-table" cellspacing="0" cellpadding="0" border="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0; mso-table-rspace: 0; border-spacing: 0; border-collapse: separate"> 
                            <tbody>
                                <tr> <!-- there needs to be content in the cell for it to render in some clients --> 
                                    <td class="email-content-rounded-top mobile-expand" style="padding: 0; border-collapse: collapse; color: #ffffff; padding: 0 15px 0 16px; height: 15px; background-color: #ffffff; border-left: 1px solid #cccccc; border-top: 1px solid #cccccc; border-right: 1px solid #cccccc; border-bottom: 0; border-top-right-radius: 5px; border-top-left-radius: 5px; height: 10px; line-height: 10px; padding: 0 15px 0 16px; mso-line-height-rule: exactly" height="10" bgcolor="#ffffff">&nbsp;</td> 
                                </tr> 
                                <tr> 
                                    <td class="email-content-main mobile-expand " style="padding: 0; border-collapse: collapse; border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; border-top: 0; border-bottom: 0; padding: 0 15px 0 16px; background-color: #ffffff" bgcolor="#ffffff"> 
                                        <table class="page-title-pattern" cellspacing="0" cellpadding="0" border="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0; mso-table-rspace: 0"> 
                                            <tbody>
                                                <tr> 
                                                    <td style="vertical-align: top;; padding: 0; border-collapse: collapse; padding-right: 5px; font-size: 20px; line-height: 30px; mso-line-height-rule: exactly" class="page-title-pattern-header-container"> <span class="page-title-pattern-header" style="font-family: Arial, sans-serif; padding: 0; font-size: 20px; line-height: 30px; mso-text-raise: 2px; mso-line-height-rule: exactly; vertical-align: middle"> <a href="https://hibernate.atlassian.net/browse/HSEARCH-3900?atlOrigin=eyJpIjoiMmY4NTYxZjQ2Njk3NDFiYTkwNDM2YTQ5YzAzNTNjMTIiLCJwIjoiaiJ9" style="color: #3b73af; text-decoration: none">Re: 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, sending the app in out of memory.</a> </span> </td> 
                                                </tr> 
                                            </tbody>
                                        </table> </td> 
                                </tr> 
                                <tr> 
                                    <td id="text-paragraph-pattern-top" class="email-content-main mobile-expand  comment-top-pattern" style="padding: 0; border-collapse: collapse; border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; border-top: 0; border-bottom: 0; padding: 0 15px 0 16px; background-color: #ffffff; border-bottom: none; padding-bottom: 0" bgcolor="#ffffff"> 
                                        <table class="text-paragraph-pattern" cellspacing="0" cellpadding="0" border="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0; mso-table-rspace: 0; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 2px"> 
                                            <tbody>
                                                <tr> 
                                                    <td class="text-paragraph-pattern-container mobile-resize-text " style="padding: 0; border-collapse: collapse; padding: 0 0 10px"> <p style="margin: 10px 0 0; margin-top: 0">Yoann, thanks for the response.</p> <p style="margin: 10px 0 0">I’ve few queries with reference to your answer. Below are the same:</p> 
                                                        <blockquote style="margin: 10px 0 0; border-left: 1px solid #cccccc; color: #707070; margin-left: 19px; padding: 10px 20px">
                                                            <p style="margin: 10px 0 0; margin-top: 0">Regardless... I'd stay away from this setting. It probably doesn't do what you think it does.</p>
                                                        </blockquote> <p style="margin: 10px 0 0">We have been using Hibernate Search from last 1.5 years on below version and these are newer than 5.5. </p> <p style="margin: 10px 0 0"><span class="image-wrap" style=""><img src="cid:jira-generated-image-static-882595ac-a6d4-4c63-b3c1-168786b17091"></span></p> <p style="margin: 10px 0 0">We still never faced this issue, we even did not manually provided the configuration of <tt>autoregister_listeners</tt> in our hibernate.cfg file. Still it was all well, the problem only started after upgrading to 5.11.5. </p> 
                                                        <blockquote style="margin: 10px 0 0; border-left: 1px solid #cccccc; color: #707070; margin-left: 19px; padding: 10px 20px">
                                                            <p style="margin: 10px 0 0; margin-top: 0">If you want to enable Hibernate Search, but prevent automatic indexing, see <a href="https://docs.jboss.org/hibernate/search/5.11/reference/en-US/html_single/#_automatic_indexing" class="external-link" rel="nofollow noreferrer" style="color: #3b73af; text-decoration: none"><ins>here</ins></a> instead. You just have to set this:</p> 
                                                            <p style="margin: 10px 0 0"><tt>hibernate.search.indexing_strategy = manual</tt></p> 
                                                            <p style="margin: 10px 0 0">Hibernate Search will still start up, but entity persisting events will be ignored. You will have to use the mass indexer in order to index your data, or explicit <tt>index</tt> commands. See <a href="https://docs.jboss.org/hibernate/search/5.11/reference/en-US/html_single/#search-batchindex" class="external-link" rel="nofollow noreferrer" style="color: #3b73af; text-decoration: none"><ins>here</ins></a> for more information.</p>
                                                        </blockquote> <p style="margin: 10px 0 0">I can not set it to manual, as in our application we have used hibernate search to update the elastic database as an when we have an add/update/delete on the entities which are @Indexed annotated. For eg. If a user adds a client data, this needs to be added on elastic server, as the search part is provided through elastic server.</p> 
                                                        <blockquote style="margin: 10px 0 0; border-left: 1px solid #cccccc; color: #707070; margin-left: 19px; padding: 10px 20px">
                                                            <p style="margin: 10px 0 0; margin-top: 0">I'll need to know which setting you're talking about. Both <tt>autoregister_listeners</tt> and <tt>indexing_strategy</tt> were introduced before version <tt>5.6</tt>, so long before Elasticsearch support was event introduced.</p>
                                                        </blockquote> <p style="margin: 10px 0 0">I’m talking about <tt>autoregister_listeners</tt> and <tt>indexing_strategy</tt> settings. As now if I keep the <tt>autoregister_listeners</tt> to false then my <tt>drop-and-create</tt> strategy does not work any longer. As we require this to update the schema on elastic side, once we modify any entity to include/exclude fields from elastic schema. These were even working correctly under 5.9 version.</p> 
                                                        <blockquote style="margin: 10px 0 0; border-left: 1px solid #cccccc; color: #707070; margin-left: 19px; padding: 10px 20px">
                                                            <p style="margin: 10px 0 0; margin-top: 0">My concern is, we do have an option of create-and-drop of indexes at sever startup, are we going to remove this option?</p> 
                                                            <p style="margin: 10px 0 0">Which you replied with “No“</p>
                                                        </blockquote> <p style="margin: 10px 0 0">If we are not planning to remove this and it will be available. How do you suggest of doing this with current scenario. Where if <tt>autoregister_listeners</tt> are true than we have the performance issue and when it is false, the whole hibernate search is disabled in the application?</p> 
                                                        <blockquote style="margin: 10px 0 0; border-left: 1px solid #cccccc; color: #707070; margin-left: 19px; padding: 10px 20px">
                                                            <p style="margin: 10px 0 0; margin-top: 0">No. It just removes all documents, but it preserves the same schema.</p> 
                                                            <p style="margin: 10px 0 0">The option to drop and recreate indexes in the mass indexer was introduced in Search 6.0.0.Beta6 (<a href="https://hibernate.atlassian.net/browse/HSEARCH-3751" class="external-link" rel="nofollow noreferrer" style="color: #3b73af; text-decoration: none"><ins>HSEARCH-3751</ins></a>); see the <tt>dropAndCreateSchemaOnStart</tt> parameter <a href="https://docs.jboss.org/hibernate/search/6.0/reference/en-US/html_single/#mapper-orm-indexing-massindexer-parameters" class="external-link" rel="nofollow noreferrer" style="color: #3b73af; text-decoration: none"><ins>here</ins></a>.</p>
                                                        </blockquote> <p style="margin: 10px 0 0">See, we can only update the data with startAndWait, but how will I refresh my schema with this as that is only possible with drop-and-create, ryt?</p> <p style="margin: 10px 0 0">Further, we were planning to go to the latest version, but then it’s in BETA stage. So we can not adapt a BETA version for our product. Do you suggest to move to the version 6 BETA, will doing this resolve all these issues?</p> 
                                                        <blockquote style="margin: 10px 0 0; border-left: 1px solid #cccccc; color: #707070; margin-left: 19px; padding: 10px 20px">
                                                            <p style="margin: 10px 0 0; margin-top: 0">No, that's useful to trigger mass indexing, reindex your data while taking your application offline. After that, you can restart your application and re-enable automatic indexing.</p> 
                                                            <p style="margin: 10px 0 0">Some people also don't use automatic indexing at all and just reindex their whole database periodically. That's not for everyone, though.</p>
                                                        </blockquote> <p style="margin: 10px 0 0">MassIndexing is fine and we do it the way you are suggesting with startAndWait(), but how do I achieve the refresh of schema. Also as you said its not the case with everyone, and yes we can not do periodic refresh, instead we need it at runtime. As I explained above in one of the comments.</p> 
                                                        <blockquote style="margin: 10px 0 0; border-left: 1px solid #cccccc; color: #707070; margin-left: 19px; padding: 10px 20px">
                                                            <p style="margin: 10px 0 0; margin-top: 0">As I already explained, setting <tt>hibernate.search.autoregister_listeners</tt> to <tt>false</tt> will just <b>disable Hibernate Search</b>. So yes, that's expected.</p>
                                                        </blockquote> <p style="margin: 10px 0 0">Are you suggesting that now the automatic indexing on add/update/delete support is lost from 5.11. Because honestly it was all fine in 5.9.</p> 
                                                        <blockquote style="margin: 10px 0 0; border-left: 1px solid #cccccc; color: #707070; margin-left: 19px; padding: 10px 20px">
                                                            <p style="margin: 10px 0 0; margin-top: 0">Where do the problems seem to happen? Just when booting? Or when the application handles HTTP requests that result in write operations on the database?</p>
                                                        </blockquote> <p style="margin: 10px 0 0">It’s only at the server booting/startup time. Otherwise the application is working as expected.</p> 
                                                        <blockquote style="margin: 10px 0 0; border-left: 1px solid #cccccc; color: #707070; margin-left: 19px; padding: 10px 20px">
                                                            <p style="margin: 10px 0 0; margin-top: 0">Did you change anything at all?</p> 
                                                            <p style="margin: 10px 0 0">Changes in your model and Search mapping could lead to dramatic performance problems if they trigger a lot of reindexing (<tt>@ContainedIn</tt>). I'm talking about indexing <em>one</em> entity leading to loading half the database. You need to be very careful about what you do with <tt>@ContainedIn</tt>.</p> 
                                                            <p style="margin: 10px 0 0">Switching from Lucene to Elasticsearch can also represent a high cost if your application is very write-intensive. In particular, you should not enable <tt>hibernate.search.default.elasticsearch.refresh_after_write</tt>. This setting will lead to terrible performance in write-intensive applications.</p>
                                                        </blockquote> <p style="margin: 10px 0 0">No I did not make any change with respect to @ContainedIn we had this functionality in 5.9 too. And yes we do have @ContainedIn relationships in elastic.</p> <p style="margin: 10px 0 0">Further, we were already on lucene and did not migrate to Elasticsearch. Also I’ve not provided <tt>hibernate.search.default.elasticsearch.refresh_after_write</tt> in my hibernate config.</p> <p style="margin: 10px 0 0">At last,</p> 
                                                        <blockquote style="margin: 10px 0 0; border-left: 1px solid #cccccc; color: #707070; margin-left: 19px; padding: 10px 20px">
                                                            <p style="margin: 10px 0 0; margin-top: 0">As I explained above, with <tt>autoregister_listeners</tt> set to <tt>false</tt>, Hibernate Search is disabled. So of course all Hibernate Search features are disabled as well.</p>
                                                        </blockquote> <p style="margin: 10px 0 0">If this setting is off, I’m left with just the hibernate search jars in my application, doing nothing 🙂. </p> <p style="margin: 10px 0 0">Please help me to overcome this issue, as now I’m more curious to understand why it was fine in 5.9 and not now with 5.11? </p> <p style="margin: 10px 0 0">Just look at this scenario in a way that my application is now dead from hibernate search side.</p> <p style="margin: 10px 0 0">Please revert if you need more details on configuration, jar dependencies we have or any other info you require to understand it in more better way.</p> </td> 
                                                </tr> 
                                            </tbody>
                                        </table> </td> 
                                </tr> 
                                <tr> 
                                    <td class="email-content-main mobile-expand " style="padding: 0; border-collapse: collapse; border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; border-top: 0; border-bottom: 0; padding: 0 15px 0 16px; background-color: #ffffff" bgcolor="#ffffff"> <script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "EmailMessage",
  "description": "View Issue",
  "potentialAction": {
    "@type": "ViewAction",
        "target": "https://hibernate.atlassian.net/browse/HSEARCH-3900?inbox=true&focusedCommentId=106561&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-106561",
    "name": "View Comment"
      },
  "publisher": {
    "@type": "Organization",
    "name": "Atlassian",
    "url": "https://www.atlassian.com"
  }
}
</script> 
                                        <table id="actions-pattern" cellspacing="0" cellpadding="0" border="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0; mso-table-rspace: 0; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 1px"> 
                                            <tbody>
                                                <tr> 
                                                    <td id="actions-pattern-container" valign="middle" style="padding: 0; border-collapse: collapse; padding: 10px 0 10px 24px; vertical-align: middle; padding-left: 0"> 
                                                        <table align="left" style="border-collapse: collapse; mso-table-lspace: 0; mso-table-rspace: 0"> 
                                                            <tbody>
                                                                <tr> 
                                                                    <td class="actions-pattern-action-icon-container" style="padding: 0; border-collapse: collapse; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 0; vertical-align: middle"> <a href="https://hibernate.atlassian.net/browse/HSEARCH-3900#add-comment?atlOrigin=eyJpIjoiMmY4NTYxZjQ2Njk3NDFiYTkwNDM2YTQ5YzAzNTNjMTIiLCJwIjoiaiJ9" target="_blank" title="Add Comment" style="color: #3b73af; text-decoration: none"> <img class="actions-pattern-action-icon-image" src="cid:jira-generated-image-static-comment-icon-821cb5d2-3357-40c6-a619-df8a728a558f" alt="Add Comment" title="Add Comment" height="16" width="16" border="0" style="vertical-align: middle"> </a> </td> 
                                                                    <td class="actions-pattern-action-text-container" style="padding: 0; border-collapse: collapse; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 4px; padding-left: 5px"> <a href="https://hibernate.atlassian.net/browse/HSEARCH-3900#add-comment?atlOrigin=eyJpIjoiMmY4NTYxZjQ2Njk3NDFiYTkwNDM2YTQ5YzAzNTNjMTIiLCJwIjoiaiJ9" target="_blank" title="Add Comment" style="color: #3b73af; text-decoration: none">Add Comment</a> </td> 
                                                                </tr> 
                                                            </tbody>
                                                        </table> </td> 
                                                </tr> 
                                            </tbody>
                                        </table> </td> 
                                </tr> <!-- there needs to be content in the cell for it to render in some clients --> 
                                <tr> 
                                    <td class="email-content-rounded-bottom mobile-expand" style="padding: 0; border-collapse: collapse; color: #ffffff; padding: 0 15px 0 16px; height: 5px; line-height: 5px; background-color: #ffffff; border-top: 0; border-left: 1px solid #cccccc; border-bottom: 1px solid #cccccc; border-right: 1px solid #cccccc; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; mso-line-height-rule: exactly" height="5" bgcolor="#ffffff">&nbsp;</td> 
                                </tr> 
                            </tbody>
                        </table> </td> 
                </tr> 
                <tr> 
                    <td id="footer-pattern" style="padding: 0; border-collapse: collapse; padding: 12px 20px"> 
                        <table id="footer-pattern-container" cellspacing="0" cellpadding="0" border="0" style="border-collapse: collapse; mso-table-lspace: 0; mso-table-rspace: 0"> 
                            <tbody>
                                <tr> 
                                    <td id="footer-pattern-mobile-separated-links" class="mobile-resize-text" width="100%" colspan="2" style="padding: 0; border-collapse: collapse; color: #999999; font-size: 12px; line-height: 18px; font-family: Arial, sans-serif; mso-line-height-rule: exactly; mso-text-raise: 2px"> Get Jira notifications on your phone! Download the Jira Cloud app for <a href="https://play.google.com/store/apps/details?id=com.atlassian.android.jira.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail" style="color: #3b73af; text-decoration: none">Android</a> or <a href="https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8" style="color: #3b73af; text-decoration: none">iOS</a> 
                                        <hr> </td> 
                                </tr> 
                                <tr> 
                                    <td id="footer-pattern-text" class="mobile-resize-text" width="100%" style="padding: 0; border-collapse: collapse; color: #999999; font-size: 12px; line-height: 18px; font-family: Arial, sans-serif; mso-line-height-rule: exactly; mso-text-raise: 2px"> This message was sent by Atlassian Jira <span id="footer-build-information">(v1001.0.0-SNAPSHOT#100125-<span title="c9660592fc42b39ddddc75c3894568ad1a1812db" data-commit-id="c9660592fc42b39ddddc75c3894568ad1a1812db}">sha1:c966059</span>)</span> </td> 
                                    <td id="footer-pattern-logo-desktop-container" valign="top" style="padding: 0; border-collapse: collapse; padding-left: 20px; vertical-align: top"> 
                                        <table style="border-collapse: collapse; mso-table-lspace: 0; mso-table-rspace: 0"> 
                                            <tbody>
                                                <tr> 
                                                    <td id="footer-pattern-logo-desktop-padding" style="padding: 0; border-collapse: collapse; padding-top: 3px; opacity: 0.150"> <img id="footer-pattern-logo-desktop" src="cid:jira-generated-image-static-footer-desktop-logo-990aef9f-311a-47ad-8724-542f55d98b8e" alt="Atlassian logo" title="Atlassian logo" width="192" height="24" class="image_fix"> </td> 
                                                </tr> 
                                            </tbody>
                                        </table> </td> 
                                </tr> 
                            </tbody>
                        </table> </td> 
                </tr> 
            </tbody>
        </table>  
    </body>
</html>