<!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/2a8bdd4ffd282b7185c74b52ab452617?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FYR-6.png" 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="yrodiere" style="color:#6c797f;; color: #3b73af; text-decoration: none" id="email_yrodiere" href="https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A58fa1ced-171a-4c00-97e8-5d70d442cc4b"> Yoann Rodière </a> <strong>updated</strong> an issue </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 class="page-title-pattern-first-line " style="padding: 0; border-collapse: collapse; font-family: Arial, sans-serif; font-size: 14px; padding-top: 10px"> <a href="https://hibernate.atlassian.net/browse/HSEARCH?atlOrigin=eyJpIjoiYTZjNWQyMDZlNWI4NGIwNmE0OTIyY2VhYmJiMWQ2NDEiLCJwIjoiaiJ9" style="color: #3b73af; text-decoration: none">Hibernate Search</a> / <a href="https://hibernate.atlassian.net/browse/HSEARCH-3903?atlOrigin=eyJpIjoiYTZjNWQyMDZlNWI4NGIwNmE0OTIyY2VhYmJiMWQ2NDEiLCJwIjoiaiJ9" style="color: #3b73af; text-decoration: none"><img src="cid:jira-generated-image-avatar-d5fc50cc-5aad-40b0-a385-867559f04fc0" height="16" width="16" border="0" align="absmiddle" alt="New Feature" style="vertical-align: text-bottom"></a> <a href="https://hibernate.atlassian.net/browse/HSEARCH-3903?atlOrigin=eyJpIjoiYTZjNWQyMDZlNWI4NGIwNmE0OTIyY2VhYmJiMWQ2NDEiLCJwIjoiaiJ9" style="color: #3b73af; text-decoration: none">HSEARCH-3903</a> </td> 
                                                </tr> 
                                                <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-3903?atlOrigin=eyJpIjoiYTZjNWQyMDZlNWI4NGIwNmE0OTIyY2VhYmJiMWQ2NDEiLCJwIjoiaiJ9" style="color: #3b73af; text-decoration: none">Filters based exclusively on mapper metadata for @IndexedEmbedded</a> </span> </td> 
                                                </tr> 
                                            </tbody>
                                        </table> </td> 
                                </tr> 
                                <tr> 
                                    <td class="email-content-main mobile-expand  wrapper-special-margin" 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; padding-top: 10px; padding-bottom: 5px" bgcolor="#ffffff"> 
                                        <table class="keyvalue-table" style="border-collapse: collapse; mso-table-lspace: 0; mso-table-rspace: 0"> 
                                            <tbody>
                                                <tr> 
                                                    <th style="color: #707070; font: normal 14px/20px Arial, sans-serif; text-align: left; vertical-align: top; padding: 2px 0">Change By:</th> 
                                                    <td style="padding: 0; border-collapse: collapse; font: normal 14px/20px Arial, sans-serif; padding: 2px 0 2px 5px; vertical-align: top"> <a class="user-hover" rel="yrodiere" style="color:#6c797f;; color: #3b73af; text-decoration: none" id="email_yrodiere" href="https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A58fa1ced-171a-4c00-97e8-5d70d442cc4b"> Yoann Rodière </a> </td> 
                                                </tr> 
                                            </tbody>
                                        </table> </td> 
                                </tr> 
                                <tr> 
                                    <td class="email-content-main mobile-expand  issue-description-container" 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; padding-top: 5px; padding-bottom: 10px" 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"> <span class="diffcontext">The {{includePaths}} filter in {{@IndexedEmbedded}} refers to index field paths. This has several drawbacks:<br><br>* Part of the implementation has to be in the backend, which feels quite dirty.<br>* This is not very consistent with the {{maxDepth}} filter, which applied to the {{@IndexedEmbedded}} only (depth of fields created within an included bridge is unlimited).<br>* The filters cannot easily be applied to dynamic fields, so dynamic fields are always included as soon as their nearest static parent is included.<br>* The filter can end up including some fields declared by a custom field bridge, but not others.<br>** This does not make sense performance-wise as the fields will still be populated by the bridge, but ignored by the backend.<br>** Worse, when we introduce support for bridge-defined predicates (HSEARCH-3320), we may end up with dysfunctional predicates because only some fields are present, while the bridge expects all fields to be present.<br>* We are forced to use inference to detect which bridges should be included or excluded, based on the fields they declared.<br>** This code is unnecessarily complex.<br>** This code does not work correctly with field templates, since we cannot know in advance whether dynamic fields will be included. In particular:<br>*** Bridges that declare field templates, but only ever add dynamic fields that would not match the {{includePaths}}, are included nonetheless.<br>*** Bridges that do not declare anything and rely on field templates declared by a parent (which is legal) are excluded.<br><br>We could get rid of most of the complexity by implementing filters differently, based on mapper metadata exclusively (mapping annotations and/or entity model).<br><br>h3. Solution 1: property paths<br><br>We could rely on property paths instead of field paths. Only bridges applied to included properties are themselves included.<br><br>The major drawback is that there wouldn't be any way to filter out type bridges.<br><br>h3. Solution 2: groups<br><br>We could rely on "groups", similarly to the {{@LazyGroup}} support in Hibernate ORM, or to the group support in Hibernate Validator.<br><br>One assigns groups to every {{@Field}}/{{@IndexedEmbedded}}, then references the groups in {{@IncludedEmbedded(includeGroups = ...)}}.<br><br>The main problem with this solution is its complexity; Validator is using groups and I know they can be pretty complex to handle. We should definitely see what makes them so complex in Validator to avoid the same problems in Search.<br><br>For example:<br><br>{code}<br>@Indexed<br>public class Level1Entity {<br><br>&nbsp;&nbsp;&nbsp;&nbsp;// Will include id only<br>&nbsp;&nbsp;&nbsp;&nbsp;@IndexedEmbedded<br>&nbsp;&nbsp;&nbsp;&nbsp;private Level2Entity level2_1;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;// Will include id, name<br>&nbsp;&nbsp;&nbsp;&nbsp;@IndexedEmbedded(includeGroups = {BuiltinGroups.DEFAULT, "base"})<br>&nbsp;&nbsp;&nbsp;&nbsp;private Level2Entity level2_2;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;// Will include id, name, category<br>&nbsp;&nbsp;&nbsp;&nbsp;@IndexedEmbedded(includeGroups = {BuiltinGroups.DEFAULT, "base", "advanced"})<br>&nbsp;&nbsp;&nbsp;&nbsp;private Level2Entity level2_3;<br><br>}<br><br>public class Level2Entity {<br><br>&nbsp;&nbsp;&nbsp;&nbsp;@GenericField // Default group<br>&nbsp;&nbsp;&nbsp;&nbsp;private String id;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;@GenericField(groups = "base")<br>&nbsp;&nbsp;&nbsp;&nbsp;private String name;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;@GenericField(groups = "advanced")<br>&nbsp;&nbsp;&nbsp;&nbsp;private String category;<br><br>}<br>{code}<br><br>h4. Variation: overriding {{includeGroups}}<br><br>It would prevent us from supporting the use case mentioned in HSEARCH-1112 directly, but I believe the same effect could be achieved if we defined group filters as "overriding" instead of "composable": an {{@IndexedEmbedded(includeGroups = "a")}} that includes an {{@IndexedEmbedded(includeGroups = "b")}} would just act as if the contained {{@IndexedEmbedded}} included group "a", and only group "a".<br><br>For example:<br><br>{code}<br>@Indexed<br>public class Level1Entity {<br><br>&nbsp;&nbsp;&nbsp;&nbsp;// Will include level2.level3.a only<br>&nbsp;&nbsp;&nbsp;&nbsp;@IndexedEmbedded(includeGroups = "a")<br>&nbsp;&nbsp;&nbsp;&nbsp;private Level2Entity level2;<br><br>}<br><br>public class Level2Entity {<br><br>&nbsp;&nbsp;&nbsp;&nbsp;@GenericField(groups = "b")<br>&nbsp;&nbsp;&nbsp;&nbsp;private String name;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;@IndexedEmbedded(includeGroups = "b") // includeGroups is overridden in Level1Entity<br>&nbsp;&nbsp;&nbsp;&nbsp;private String id;<br><br>}<br><br>public class Level3Entity {<br><br>&nbsp;&nbsp;&nbsp;&nbsp;@GenericField(groups = "a")<br>&nbsp;&nbsp;&nbsp;&nbsp;private String a;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;@GenericField(groups = "b")<br>&nbsp;&nbsp;&nbsp;&nbsp;private String b;<br><br>}<br>{code}<br><br>There are pros and cons:<br><br>* Pro: Groups may be easier to implement and understand: the various filters defined in indexed-embedded entities would no longer be relevant. One could argue that it's the opposite, though: the fact that filters defined in indexed-embedded entities are ignored can be confusing.<br>* Con: it would become harder to manage cycles through group filtering: you would no longer be able to rely on indexed-embedded entities to filter out cycles through groups (since their group filters are ignored).<br>* Con: the behavior would not be consistent with that of {{maxDepth}}.<br><br>h3. Next<br><br>h4. Deprecation<br><br>As a second step, we should probably deprecate {{includePaths}} and mark it for removal in a later major version (7+).<br><br>h4. Going further: dynamic group selection<br><br>One could imagine to allow selecting groups dynamically.</span> <span class="diffremovedchars" style="background-color: #ffe7e7; text-decoration:line-through;"> All the groups that *can* be selected would be included in the index schema, and when indexing some fields would get enabled or not based on the dynamic group selection.<br><br>This would provide a feature similar to the {{AlternativeBinder}}, but much more powerful.<br><br>There is one unknown, though: how would {{@IndexedEmbedded.includeGroups}} interact with the dynamic group selection? If dynamic group selection is overridden by {{@IndexedEmbedded.includeGroups}}, it will likely not work as intended for the "multi</span> <span class="diffaddedchars" style="background-color:#ddfade;"> See HSEARCH</span> <span class="diffcontext">-</span> <span class="diffremovedchars" style="background-color: #ffe7e7; text-decoration:line-through;">language" use case of {{AlternativeBinder}}</span> <span class="diffaddedchars" style="background-color:#ddfade;">3971</span> <span class="diffcontext">.</span> <span class="diffremovedchars" style="background-color: #ffe7e7; text-decoration:line-through;"> If dynamic group selection ignores {{@IndexedEmbedded.includeGroups}}, it will become impossible to exclude dynamically enabled fields from {{@IndexedEmbedded}}.</span> <span class="diffcontext"><br><br></span> <span class="diffremovedchars" style="background-color: #ffe7e7; text-decoration:line-through;">Maybe we should separate the two concepts, e.g. {{@GenericField(groups = ..., dynamicGroups = ...)}}?<br><br>Or maybe we should assign a static group to the "dynamic group resolver": the resolver and all corresponding fields would be included in the schema if the resolver's assigned static group is included, even if the field's (dynamic) groups are not included. Then it would be the user's responsibility to make sure static and dynamic groups use different names, so as not to include dynamic groups statically by mistake.<br><br></span> <span class="diffcontext">h4. Going further: using field groups to select fields in the search DSL<br><br>We could address HSEARCH-3926 by contributing groups to the index metamodel: {{@GenericField(groups = "foo")}} would assign the group "foo" to the corresponding index field, which could then be targeted at query time by selecting the group "foo".</span> <span class="diffaddedchars" style="background-color:#ddfade;"> See HSEARCH-3926 for more information.</span> <span class="diffcontext"><br></span> <span class="diffremovedchars" style="background-color: #ffe7e7; text-decoration:line-through;"><br>This would be a reasonable use of groups, I believe?<br></span> </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-3903?inbox=true&",
    "name": "View Issue"
      },
  "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-3903#add-comment?atlOrigin=eyJpIjoiYTZjNWQyMDZlNWI4NGIwNmE0OTIyY2VhYmJiMWQ2NDEiLCJwIjoiaiJ9" 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-be9f20d1-ada4-43a0-a16b-4e9dad824474" 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-3903#add-comment?atlOrigin=eyJpIjoiYTZjNWQyMDZlNWI4NGIwNmE0OTIyY2VhYmJiMWQ2NDEiLCJwIjoiaiJ9" 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#100140-<span title="fbb0377b3ab7ea61e9e469b27152b7e441e7764d" data-commit-id="fbb0377b3ab7ea61e9e469b27152b7e441e7764d}">sha1:fbb0377</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-9df302e2-836d-44c6-a51b-70920b658173" 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>