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/31 03:38:04 UTC

[jira] [Commented] (SOLR-7853) support min(multivalued_field_name) and max(multivalued_field_name) syntax

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

Hoss Man commented on SOLR-7853:
--------------------------------

My Comments from SOLR-2522...


{quote}
The root complexity is that the ValueSourceParsers all delegate to FunctionQParser.parseValueSource() (or parseValueSourceList()) when expecting an argument that can be an arbitrary (nested) ValueSource -- this is how min & max work now.  FQP.parseValueSource() handles the logic of figuring out what hte argument is (literal, nested function, $variable, field name, etc...) and if it's a field name, calls {{f.getType().getValueSource(f, this)}} on the associated SchemaField -- which for multivalued fields throws an exception that gets propogated up.

My initial thinking was that i could refactor parseValueSource() to support another flag for either specifying the MultiValueSelector, or indicating that we want a "defered evaluation" of the underlying SchemaFields (ie: return some mock FieldBasedValueSource that doesn't call FieldType.getValueSource until used, so the min/max functions can explicitly call getSingleValueSource() instead if they encounter a single argument) but then i realized that because of how FunctionQParser deals with $variable derefrencing -- and the QParser abstraction (variables might refer to other queries, which get automatically unwrapped if they are FunctionQueries) then even that type of refacotring solution wouldn't work in simple use cases like this...

{noformat}
...
& fl=id,min($my_f)
& my_f=some_multi_valued_field_name
{noformat}

So I'm going to punt on getting the {{min(some_multi_valued_field_name)}} (and {{max(some_multi_valued_field_name)}}) syntax working, and leave that as a usibillitiy improvement for the future.
{quote}

> support min(multivalued_field_name) and max(multivalued_field_name) syntax
> --------------------------------------------------------------------------
>
>                 Key: SOLR-7853
>                 URL: https://issues.apache.org/jira/browse/SOLR-7853
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Hoss Man
>
> The changes in SOLR-2522 are adding support for using {{field(field_name,'min')}} and {{field(field_name,'max')}} as a way to use the min/max of a multivalued docvalues field in functions at query time.
> The ideal syntax would be to support this as a varient on the existing {{min()}} and {{max()}} functions -- which would be more intuitive for users, but getting this to work is non trivial, so it's been split out as a distinct issue for future improvement.



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