You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Hoss Man (JIRA)" <ji...@apache.org> on 2015/07/30 02:02:05 UTC

[jira] [Updated] (SOLR-2522) Change max() and min() to work on multiValued fields

     [ https://issues.apache.org/jira/browse/SOLR-2522?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hoss Man updated SOLR-2522:
---------------------------
    Attachment: SOLR-2522.patch


I don't think this was possible back when the issue was first filed because of how the ValueSource API was tied so closely with the FieldCache API.  

But with DocValues API, this is in fact now possible -- but only for fields that actually use DocValues.  The UninvertedReader's implementation of SortedSetDocValues doesn't support RandomAccessOrds so we can't support those (yet - i'll file a related issue to see if it's possible to improve that later)

The attached patch has a starting point for an implementation of this for all of the TrieFields and some basic tests (but i want to add some more randomized tests as well, in addition to tests of some of the error cases.)

The main thing that's missing from this patch is the syntax -- getting "min(multivalued_field_name)" to work is non trivial, so for now i just hacked in a "minf(fieldname)" and "maxf(fieldname)" function to get something i could write tests against -- working on the ValueSourceParser changes to get the syntax we all want to work is the next big thing on the agenda.

The other thing i want to look into is LUCENE-6609 -- the same comments there about directly using the SortField for the underlying field should also correlate here: changing SortedSetFieldSource.getSortField() to return an instance of SortedSetSortField.



> Change max() and min() to work on multiValued fields 
> -----------------------------------------------------
>
>                 Key: SOLR-2522
>                 URL: https://issues.apache.org/jira/browse/SOLR-2522
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Bill Bell
>         Attachments: SOLR-2522.patch
>
>
> Switch max() and min() functions to work on multiValued fields so we can 
> do sort=min(fieldname) asc and the sort would work on multiValued fields...



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org