[hibernate-issues] [JIRA] (HSEARCH-3103) Sorts on multi-valued fields

Waldemar Kłaczyński (JIRA) jira at hibernate.atlassian.net
Mon Mar 9 18:11:15 EDT 2020


Waldemar Kłaczyński ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A77e50cac-bda3-4af4-9bb3-6461f4d10eea ) *commented* on HSEARCH-3103 ( https://hibernate.atlassian.net/browse/HSEARCH-3103?atlOrigin=eyJpIjoiMzgwNTE3OGIyMTEwNDVlYjg4YzA3OWVlY2ZlMjIxZmMiLCJwIjoiaiJ9 )

Re: Sorts on multi-valued fields ( https://hibernate.atlassian.net/browse/HSEARCH-3103?atlOrigin=eyJpIjoiMzgwNTE3OGIyMTEwNDVlYjg4YzA3OWVlY2ZlMjIxZmMiLCJwIjoiaiJ9 )

Maybe to speed up sorting, you can save in the field definition how it should behave when storing values. So eventually he would remember only one field, max, min, avg, etc ... Later sorting would consist of reading only one field. It would be a good solution in a flat model. This would speed up document search.

Indexing the field in such a way would prevent you from choosing a different aggregation method, but it is not always necessary for everyone. So the user would decide between search performance and subsequent dynamic search capability.

@GenericField(name = "bruttoPrice_sort" , sortable = Sortable.YES, mode = MultiValue.AVG)

The user would have to choose whether to remember the calculated value or to calculate it during sorting.

As for calculating values, median counting for nested multiple values is inefficient. This requires creating an array with the number of nested value elements in order to sort it. So calculating values when creating an index would be the solution here. Some functions, especially those that pull values up to aggregation, can be simplified for multiple nested values. So that he doesn't use ArrayList.

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

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#100121- sha1:db27712 )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hibernate-issues/attachments/20200309/2a47ee0c/attachment.html 


More information about the hibernate-issues mailing list