You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "Alessandro Benedetti (Jira)" <ji...@apache.org> on 2021/06/10 08:22:00 UTC

[jira] [Commented] (SOLR-11854) multiValued PrimitiveFieldType should implicitly sort on min/max based on the asc/desc keyword

    [ https://issues.apache.org/jira/browse/SOLR-11854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17360649#comment-17360649 ] 

Alessandro Benedetti commented on SOLR-11854:
---------------------------------------------

hi [~hossman], taking a look at the documentation wiki (and the change to the documentation that happened with this ticket, I read:

"The value of any primitive field (numerics, string, boolean, dates, etc.) which has docValues="true" (or multiValued="false" and indexed="true", in which case the indexed terms will used to build DocValue like structures on the fly at runtime)"

Is this still correct after this ticket? It feels to me that with this ticket, you don't need docValues anymore to sort on multi-valued fields
i.e. 
bq. (or multiValued="false" and indexed="true",
Doesn't stand true anymore?


> multiValued PrimitiveFieldType should implicitly sort on min/max based on the asc/desc keyword
> ----------------------------------------------------------------------------------------------
>
>                 Key: SOLR-11854
>                 URL: https://issues.apache.org/jira/browse/SOLR-11854
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Chris M. Hostetter
>            Assignee: Chris M. Hostetter
>            Priority: Major
>             Fix For: 7.3, 8.0
>
>         Attachments: SOLR-11854.patch, SOLR-11854.patch
>
>
> Back in SOLR-2522, I added new syntax for (numeric) fields such that the {{field(someMultivaluedFieldName,min|max)}} syntax could be used to select either the min or max value of a multivalued (docvalues) field for use in other functions -- or for sorting.
> A little while back, it occured to me that a good "default" behavior for all primative multivalued fields would be:
> * automatically use the "min" value when {{sort=someMultivaluedFieldName asc}} is attempted
> * automatically use the "max" value when {{sort=someMultivaluedFieldName desc}} is attempted
> These defaults seem like they would be a big improvement over the current "throw an error" default behavior -- especially since it naturally reduces down in the trivial case where all docs have at most 1 value anyway -- and would align in practice with how most people I've talked to seem to think "sorting on a multivalued field" should work in theory.   If users don't like these dafaults, they can always use the explicit {{field(foo,min|max)}} syntax instead (ex: if users always want multivalued fields to sort on the 'min' value, regardless of the asc|desc selector)
> I've been experimenting with this off and on for a while, working up a POC patch -- I think it's worth doing (details to follow in comment)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org