<!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&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">
</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] <sannegrinovero> emmanuel: looking at the @SortField discussion, there are two aspects which need to be further analysed
[16:54] <sannegrinovero> 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] <sannegrinovero> 2# how to link it to index fields which are not directly generated by the annotated property?
[17:00] <emmanuel> how do you put a @SortedField on a ToMany? Via @IndexedEmbedded sannegrinovero ?
[17:00] <emmanuel> if yes, then that's not worse than before
[17:00] <emmanuel> the annotation would be valid in some cases but not in the embedded case
[17:01] <sannegrinovero> emmanuel: right, but what do you do in terms of validation?
[17:01] <emmanuel> hippie style
[17:01] <emmanuel> let go
[17:01] <sannegrinovero> I guess we can log a warning at runtime when the fieldname is chosen for a sorted query
[17:01] <sannegrinovero> but you can't throw up at boot time
[17:02] <emmanuel> yes, the query time seems like a good slot to warn against that
[17:02] <emmanuel> or even through an exception
[17:02] <sannegrinovero> right, this case could even be an exception.
[17:02] <emmanuel> can you elaborate on 2?
[17:02] <emmanuel> custom field bridge for example?
[17:02] <emmanuel> or are you thinking of someting else?
[17:03] <sannegrinovero> yea, a custom fieldbridge or even a ClassBridge
[17:03] <sannegrinovero> A custom FieldBridge could still somewhat be related to an entity property, but the ClassBridge doesn't have that link
[17:03] <emmanuel> if that's a classbridge, I think a class level @SortField-ish annotation could be used
[17:04] <emmanuel> I dont' know enough of how that's implemented to know the real link between a property and the doc value generation
[17:04] <emmanuel> so I don't have a grasp on how custom field bridges play here
[17:04] <sannegrinovero> Ok, so shoul we allow the type on class already, or should we not make early concessions..
[17:05] <sannegrinovero> I'd be tempted to start this w/o an option for fields defined by a ClassBridge, just pointing out the limitation
[17:05] <emmanuel> i thnk that would be my current preference
[17:05] <emmanuel> I'd rather we force bridges ot provide field metadata
[17:06] <sannegrinovero> Me too. But does it affect your overall view on how this metadata should be defined:
[17:06] <sannegrinovero> it really looks like the "sort fields" are strongly coupled to the root entity only, and not so much with the properties
[17:07] <sannegrinovero> 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] <sannegrinovero> (that's considering limitation #1 as well)
[17:09] <emmanuel> sannegrinovero: so would be fields I guess
[17:09] <emmanuel> ah no because the sort field would feed (data wise) from the regular field
[17:09] <emmanuel> so why is @Field(sort=YES) insufficient?
[17:10] <emmanuel> in which case is sorta solves the bridge issue as well as the bridge would drive sortability like it drives indexability
[17:11] <sannegrinovero> generally a @Field is bound to an entity property to have it "generate fields", but in the sorting case you want to know which one of the generated fields..
[17:12] <sannegrinovero> 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] <sannegrinovero> emmanuel: different but related question: should we allow to sort on a *property name*?
[17:13] <emmanuel> what did we allow before?
[17:13] <emmanuel> I am not sure why would would or even could revisit that in a 5.5
[17:13] <sannegrinovero> we allowed anything, and no validations.
[17:14] <sannegrinovero> 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] <emmanuel> we still don't ahve a sort DSL right?
[17:15] <sannegrinovero> right
[17:15] <emmanuel> in a ideal world, I would want people to sort by property
[17:15] <emmanuel> searhc by property
[17:15] <emmanuel> everything at the object level
[17:15] <emmanuel> de factor
[17:15] <emmanuel> o
[17:15] <sannegrinovero> 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] <sannegrinovero> into a sort on multiple fields
[17:15] <emmanuel> but with option to shift gear towards plain Lucene level as we have seen that i is useful for powerusers
[17:16] <sannegrinovero> Ok, yes that's what I wanted to check. Thanks.
[17:17] <sannegrinovero> so when we revisit FieldBridge SPI & 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] <emmanuel> sannegrinovero: right, for example, a year/month/day multi field bridge would know how to sort
[17:19] <emmanuel> a price + currency *might* know
[17:19] <emmanuel> a Map<k,v> to map.k = v will not know
[17:20] <emmanuel> a bridge storing in different language is screwed too :D
[17:20] <emmanuel> this is tough
[17:21] <sannegrinovero> I guess we'll have to treat is a an "aspect"
[17:21] <sannegrinovero> not mandatory for all bridges
[17:23] <emmanuel> I think I would like this aspect o be about "sortability"
[17:23] <emmanuel> and the user have the abiloty to enable sorting or not on the field using that bridge or not
[17:23] <emmanuel> that's the most inuitive to me
[17:23] <emmanuel> and indeed we might need to do like @IndexedEmbedded and offer a flat list like you say
[17:24] <emmanuel> for sorted properties form a root
[17:27] <sannegrinovero> emmanuel: so you'd expect a set of "SortabilityBridge" implementations, one per type, as a parallel concept to Fieldbridge and we allow some form of mix&match with different bridges and sorters?
[17:28] <sannegrinovero> It all needs to be agnostic of Lucene types too :)
[17:28] <emmanuel> why would you separate it from FieldBridge?
[17:29] <emmanuel> to me a sortable thing would be a fieldbridge
[17:29] <emmanuel> or classbridge
[17:30] <sannegrinovero> ok, that's what I was thinking too when I said an "aspect", but then you seemed to imply you'd make it more of a separate thing
[17:30] <emmanuel> I don't think there is much benefits into spliting it
[17:31] <emmanuel> 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] <sannegrinovero> BTW at the end of the day we should really just provide the "flat list" 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] <sannegrinovero> 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">
</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>