<!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: #333; 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: 0pt; mso-table-rspace: 0pt; background-color: #f5f5f5; border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt"> 
            <!-- header here --> 
            <tr> 
                <td id="header-pattern-container" style="padding: 0px; border-collapse: collapse; padding: 10px 20px"> 
                    <table id="header-pattern" cellspacing="0" cellpadding="0" border="0" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt"> 
                        <tr> 
                            <td id="header-avatar-image-container" valign="top" style="padding: 0px; border-collapse: collapse; vertical-align: top; width: 32px; padding-right: 8px"> <img id="header-avatar-image" class="image_fix" src="https://secure.gravatar.com/avatar/57637a2eb871b34eba14e700c78c6a5d?d=mm&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: 0px; 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="sanne" id="email_sanne" href="https://hibernate.atlassian.net/secure/ViewProfile.jspa?name=sanne" style="color:#6c797f;; color: #3b73af; text-decoration: none">Sanne Grinovero</a> <strong>commented</strong> on <a href="https://hibernate.atlassian.net/browse/HSEARCH-1984" style="color: #3b73af; text-decoration: none"><img src="cid:jira-generated-image-avatar-9c9448c0-729d-4d35-9333-baaa276d0597" height="16" width="16" border="0" align="absmiddle" alt="New Feature" /> HSEARCH-1984</a> 
                            </td> 
                        </tr> 
                    </table> 
                </td> 
            </tr> 
            <tr> 
                <td id="email-content-container" style="padding: 0px; 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: 0pt; mso-table-rspace: 0pt; border-spacing: 0; border-collapse: separate"> 
                        <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: 0px; border-collapse: collapse; color: #fff; padding: 0 15px 0 16px; height: 15px; background-color: #fff; border-left: 1px solid #ccc; border-top: 1px solid #ccc; border-right: 1px solid #ccc; 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">
                                &nbsp;
                            </td> 
                        </tr> 
                        <tr> 
                            <td class="email-content-main mobile-expand " style="padding: 0px; border-collapse: collapse; border-left: 1px solid #ccc; border-right: 1px solid #ccc; border-top: 0; border-bottom: 0; padding: 0 15px 0 16px; background-color: #fff"> 
                                <table class="page-title-pattern" cellspacing="0" cellpadding="0" border="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt"> 
                                    <tr> 
                                        <td style="vertical-align: top;; padding: 0px; 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-1984" style="color: #3b73af; text-decoration: none">Re: Provide means of configuring fields to sort on</a> </span> 
                                        </td> 
                                    </tr> 
                                </table> 
                            </td> 
                        </tr> 
                        <tr> 
                            <td id="text-paragraph-pattern-top" class="email-content-main mobile-expand  comment-top-pattern" style="padding: 0px; border-collapse: collapse; border-left: 1px solid #ccc; border-right: 1px solid #ccc; border-top: 0; border-bottom: 0; padding: 0 15px 0 16px; background-color: #fff; border-bottom: none; padding-bottom: 0"> 
                                <table class="text-paragraph-pattern" cellspacing="0" cellpadding="0" border="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 2px"> 
                                    <tr> 
                                        <td class="text-paragraph-pattern-container mobile-resize-text " style="padding: 0px; border-collapse: collapse; padding: 0 0 10px 0"> 
                                            <p style="margin: 10px 0 0 0">A first proposal:<br /> <a href="https://gist.github.com/gunnarmorling/4ab262cf1fc772047897" class="external-link" rel="nofollow" style="color: #3b73af; text-decoration: none">https://gist.github.com/gunnarmorling/4ab262cf1fc772047897</a></p> 
                                            <p style="margin: 10px 0 0 0">And some further considerations happened on IRC:</p> 
                                            <div class="preformatted panel" style="border-width: 1px;; border: 1px solid #ccc; background: #f5f5f5; font-size: 12px; line-height: 1.333; font-family: monospace; border: 1px solid #ccc; -moz-border-radius: 3px 3px 3px 3px; border-radius: 3px 3px 3px 3px; margin: 9px 0">
                                                <div class="preformattedContent panelContent" style="padding: 9px 12px"> 
                                                    <pre style="margin: 10px 0 0 0; max-height: 30em; overflow: auto; white-space: pre-wrap; word-wrap: normal; white-space: pre; word-break: normal; word-wrap: break-word; word-break: break-word; white-space: pre-wrap">[16:53] &lt;sannegrinovero&gt; emmanuel: looking at the @SortField discussion, there are two aspects which need to be further analysed
[16:54] &lt;sannegrinovero&gt; 1# if the field is in a _ToMany relation (or iterated in any other way) it's not valid, although it might be valid for other target types if they are indexed as well
[16:55] &lt;sannegrinovero&gt; 2# how to link it to index fields which are not directly generated by the annotated property?
[17:00] &lt;emmanuel&gt; how do you put a @SortedField on a ToMany? Via @IndexedEmbedded sannegrinovero ?
[17:00] &lt;emmanuel&gt; if yes, then that's not worse than before
[17:00] &lt;emmanuel&gt; the annotation would be valid in some cases but not in the embedded case
[17:01] &lt;sannegrinovero&gt; emmanuel: right, but what do you do in terms of validation?
[17:01] &lt;emmanuel&gt; hippie style
[17:01] &lt;emmanuel&gt; let go
[17:01] &lt;sannegrinovero&gt; I guess we can log a warning at runtime when the fieldname is chosen for a sorted query
[17:01] &lt;sannegrinovero&gt; but you can't throw up at boot time
[17:02] &lt;emmanuel&gt; yes, the query time seems like a good slot to warn against that
[17:02] &lt;emmanuel&gt; or even through an exception
[17:02] &lt;sannegrinovero&gt; right, this case could even be an exception.
[17:02] &lt;emmanuel&gt; can you elaborate on 2?
[17:02] &lt;emmanuel&gt; custom field bridge for example?
[17:02] &lt;emmanuel&gt; or are you thinking of someting else?
[17:03] &lt;sannegrinovero&gt; yea, a custom fieldbridge or even a ClassBridge
[17:03] &lt;sannegrinovero&gt; A custom FieldBridge could still somewhat be related to an entity property, but the ClassBridge doesn't have that link
[17:03] &lt;emmanuel&gt; if that's a classbridge, I think a class level @SortField-ish annotation could be used
[17:04] &lt;emmanuel&gt; I dont' know enough of how that's implemented to know the real link between a property and the doc value generation
[17:04] &lt;emmanuel&gt; so I don't have a grasp on how custom field bridges play here
[17:04] &lt;sannegrinovero&gt; Ok, so shoul we allow the type on class already, or should we not make early concessions..
[17:05] &lt;sannegrinovero&gt; I'd be tempted to start this w/o an option for fields defined by a ClassBridge, just pointing out the limitation
[17:05] &lt;emmanuel&gt; i thnk that would be my current preference
[17:05] &lt;emmanuel&gt; I'd rather we force bridges ot provide field metadata
[17:06] &lt;sannegrinovero&gt; Me too. But does it affect your overall view on how this metadata should be defined:
[17:06] &lt;sannegrinovero&gt; it really looks like the &quot;sort fields&quot; are strongly coupled to the root entity only, and not so much with the properties
[17:07] &lt;sannegrinovero&gt; So for example - thinking out of the box - it could be just a list of field names defined by an annotation on the root type.
[17:07] &lt;sannegrinovero&gt; (that's considering limitation #1 as well)
[17:09] &lt;emmanuel&gt; sannegrinovero: so would be fields I guess
[17:09] &lt;emmanuel&gt; ah no because the sort field would feed (data wise) from the regular field
[17:09] &lt;emmanuel&gt; so why is @Field(sort=YES) insufficient?
[17:10] &lt;emmanuel&gt; in which case is sorta solves the bridge issue as well as the bridge would drive sortability like it drives indexability
[17:11] &lt;sannegrinovero&gt; generally a @Field is bound to an entity property to have it &quot;generate fields&quot;, but in the sorting case you want to know which one of the generated fields..
[17:12] &lt;sannegrinovero&gt; I think there's a mismatch with @Field as that annotation is treated recursively via @IndexedEmbedded, while in this case we don't want that kind of recursion
[17:13] &lt;sannegrinovero&gt; emmanuel: different but related question: should we allow to sort on a *property name*?
[17:13] &lt;emmanuel&gt; what did we allow before?
[17:13] &lt;emmanuel&gt; I am not sure why would would or even could revisit that in a 5.5
[17:13] &lt;sannegrinovero&gt; we allowed anything, and no validations.
[17:14] &lt;sannegrinovero&gt; althought since the user was not being helped (no sorting DSL), the user had to play with document field names (definitely not property names)
[17:14] &lt;emmanuel&gt; we still don't ahve a sort DSL right?
[17:15] &lt;sannegrinovero&gt; right
[17:15] &lt;emmanuel&gt; in a ideal world, I would want people to sort by property
[17:15] &lt;emmanuel&gt; searhc by property
[17:15] &lt;emmanuel&gt; everything at the object level
[17:15] &lt;emmanuel&gt; de factor
[17:15] &lt;emmanuel&gt; o
[17:15] &lt;sannegrinovero&gt; I'm asking this now - even if we don't want to do this now - because it would be good to know if we should inherently re-map (one day) a property whic his mapped to multiple fields
[17:15] &lt;sannegrinovero&gt; into a sort on multiple fields
[17:15] &lt;emmanuel&gt; but with option to shift gear towards plain Lucene level as we have seen that i is useful for powerusers
[17:16] &lt;sannegrinovero&gt; Ok, yes that's what I wanted to check. Thanks.
[17:17] &lt;sannegrinovero&gt; so when we revisit FieldBridge SPI &amp; co we should not only make sure to track which fields it's going to generate but also to have it generate multi-field sort definitions
[17:19] &lt;emmanuel&gt; sannegrinovero: right, for example, a year/month/day multi field bridge would know how to sort
[17:19] &lt;emmanuel&gt; a price + currency *might* know
[17:19] &lt;emmanuel&gt; a Map&lt;k,v&gt; to map.k = v will not know
[17:20] &lt;emmanuel&gt; a bridge storing in different language is screwed too :D
[17:20] &lt;emmanuel&gt; this is tough
[17:21] &lt;sannegrinovero&gt; I guess we'll have to treat is a an &quot;aspect&quot;
[17:21] &lt;sannegrinovero&gt; not mandatory for all bridges
[17:23] &lt;emmanuel&gt; I think I would like this aspect o be about &quot;sortability&quot;
[17:23] &lt;emmanuel&gt; and the user have the abiloty to enable sorting or not on the field using that bridge or not
[17:23] &lt;emmanuel&gt; that's the most inuitive to me
[17:23] &lt;emmanuel&gt; and indeed we might need to do like @IndexedEmbedded and offer a flat list like you say
[17:24] &lt;emmanuel&gt; for sorted properties form a root
[17:27] &lt;sannegrinovero&gt; emmanuel: so you'd expect a set of &quot;SortabilityBridge&quot; implementations, one per type, as a parallel concept to Fieldbridge and we allow some form of mix&amp;match with different bridges and sorters?
[17:28] &lt;sannegrinovero&gt; It all needs to be agnostic of Lucene types too :)
[17:28] &lt;emmanuel&gt; why would you separate it from FieldBridge?
[17:29] &lt;emmanuel&gt; to me a sortable thing would be a fieldbridge
[17:29] &lt;emmanuel&gt; or classbridge
[17:30] &lt;sannegrinovero&gt; ok, that's what I was thinking too when I said an &quot;aspect&quot;, but then you seemed to imply you'd make it more of a separate thing
[17:30] &lt;emmanuel&gt; I don't think there is much benefits into spliting it
[17:31] &lt;emmanuel&gt; what I mean rather is that a sorrableFieldBridge might not generate a doc value if the user has not set @SortBridge (or whatever that is)
[17:31] &lt;sannegrinovero&gt; BTW at the end of the day we should really just provide the &quot;flat list&quot; of everything, not just sort fields, but engage the @IndexedEmbedded recursion capabilities just as a convenience to have the users make their shopping list at least effort.
[17:31] &lt;sannegrinovero&gt; ok, looks we agree then.</pre> 
                                                </div>
                                            </div> 
                                        </td> 
                                    </tr> 
                                </table> 
                            </td> 
                        </tr> 
                        <tr> 
                            <td class="email-content-main mobile-expand " style="padding: 0px; border-collapse: collapse; border-left: 1px solid #ccc; border-right: 1px solid #ccc; border-top: 0; border-bottom: 0; padding: 0 15px 0 16px; background-color: #fff"> 
                                <table id="actions-pattern" cellspacing="0" cellpadding="0" border="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 1px"> 
                                    <tr> 
                                        <td id="actions-pattern-container" valign="middle" style="padding: 0px; border-collapse: collapse; padding: 10px 0 10px 24px; vertical-align: middle; padding-left: 0"> 
                                            <table align="left" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt"> 
                                                <tr> 
                                                    <td class="actions-pattern-action-icon-container" style="padding: 0px; border-collapse: collapse; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 0px; vertical-align: middle"> <a href="https://hibernate.atlassian.net/browse/HSEARCH-1984#add-comment" 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-6cbfde1d-e034-430e-88e9-26409182bca3" 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: 0px; 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-1984#add-comment" target="_blank" title="Add Comment" style="color: #3b73af; text-decoration: none">Add Comment</a> 
                                                    </td> 
                                                </tr> 
                                            </table> 
                                        </td> 
                                    </tr> 
                                </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: 0px; border-collapse: collapse; color: #fff; padding: 0 15px 0 16px; height: 5px; line-height: 5px; background-color: #fff; border-top: 0; border-left: 1px solid #ccc; border-bottom: 1px solid #ccc; border-right: 1px solid #ccc; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; mso-line-height-rule: exactly">
                                &nbsp;
                            </td> 
                        </tr> 
                    </table> 
                </td> 
            </tr> 
            <tr> 
                <td id="footer-pattern" style="padding: 0px; border-collapse: collapse; padding: 12px 20px"> 
                    <table id="footer-pattern-container" cellspacing="0" cellpadding="0" border="0" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt"> 
                        <tr> 
                            <td id="footer-pattern-text" class="mobile-resize-text" width="100%" style="padding: 0px; border-collapse: collapse; color: #999; 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">(v7.0.0-OD-04-018#70102-<span title="7e84d93d6047c1dc7a9a46c283169cffaf7d247b" data-commit-id="7e84d93d6047c1dc7a9a46c283169cffaf7d247b}">sha1:7e84d93</span>)</span> 
                            </td> 
                            <td id="footer-pattern-logo-desktop-container" valign="top" style="padding: 0px; border-collapse: collapse; padding-left: 20px; vertical-align: top"> 
                                <table style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt"> 
                                    <tr> 
                                        <td id="footer-pattern-logo-desktop-padding" style="padding: 0px; border-collapse: collapse; padding-top: 3px"> <img id="footer-pattern-logo-desktop" src="cid:jira-generated-image-static-footer-desktop-logo-ed1354cc-9b5c-44cf-96e1-72ac5758a576" alt="Atlassian logo" title="Atlassian logo" width="169" height="36" class="image_fix" /> 
                                        </td> 
                                    </tr> 
                                </table> 
                            </td> 
                        </tr> 
                    </table> 
                </td> 
            </tr> 
        </table>   
    </body>
</html>