You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "David Smiley (JIRA)" <ji...@apache.org> on 2015/08/30 06:30:45 UTC

[jira] [Commented] (SOLR-2522) add syntax for selecting the min or max of a multivalued field in value source functions

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

David Smiley commented on SOLR-2522:
------------------------------------

BTW I noticed a performance improvement possibility in the implementations of the ValueFiller returned from code in TrieLongField and probably the other field types that were introduced by this issue. Look at the fillValue method.  The code there is populating "exists" and is then populating the "value".  According to a recent interaction I had with Adrien on some issue or another on fillValue, looking up "exists" is potentially one disk seek and looking up the "value" is another.  By relying on the knowledge that the default value is '0' when exists is false, you can only bother checking for "exists" when the value is 0 to differentiate between the default 0 versus an explicit 0.  For Example LongFieldSource's fillValue() looks like this:
{code:java}
mval.value = arr.get(doc);
mval.exists = mval.value != 0 || valid.get(doc);
{code}
In TrieLongField's longVal() it should check if the bytes is 0 length and if so return 0 instead of attempting to decode, which will fail (I tried).

> add syntax for selecting the min or max of a multivalued field in value source functions
> ----------------------------------------------------------------------------------------
>
>                 Key: SOLR-2522
>                 URL: https://issues.apache.org/jira/browse/SOLR-2522
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Bill Bell
>            Assignee: Hoss Man
>             Fix For: 5.3, Trunk
>
>         Attachments: SOLR-2522.patch, SOLR-2522.patch, SOLR-2522.patch
>
>
> Initial request...
> bq. 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 specific syntax has been spun off into SOLR-7853, but the underlying functionality s being implemented here using a new optional second argument to the {{field()}} function: {{field(multivalued_field_name,min)}} and {{field(multivalued_field_name,max)}}.



--
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