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

Yonik Seeley commented on SOLR-11706:
-------------------------------------

Perhaps a bug at the user level, but more of a "not implemented yet" at the 
development level.

bq. Based on the stack traces, i gather the problem is because the FacetModule 
seems to rely exclusively on using the "Function" parsers to get a value source 
– apparently w/o any other method of accumulating numeric stats from 
multivalued (numeric) DocValues?

That was the original reason.  As part of SOLR-11317 I added a bit of a hacky 
way to support a function or a bare field name (w/o trying to make the field 
name into a value source).
min/max parsers currently use this:
{code}
    addParser("agg_min", new ValueSourceParser() {
      @Override
      public ValueSource parse(FunctionQParser fp) throws SyntaxError {
        return new MinMaxAgg("min", 
fp.parseValueSource(FunctionQParser.FLAG_DEFAULT | 
FunctionQParser.FLAG_USE_FIELDNAME_SOURCE));
      }
    });
{code}

Now in MinMaxAgg, we deal with fields separately from functions and throw an 
exception for a multivalued field since there is no implementation yet:
{code}
      if (sf.multiValued() || sf.getType().multiValuedFieldCache()) {
        vs = null;
        throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "min/max 
aggregations can't be used on multi-valued field " + field);
{code}

We could either:
 - use the same strategy for all the stats (fine if we only care about 
multi-valued fields and not multi-valued functions)
 - fix ValueSource so that it can be truly multi-valued and use that


> JSON FacetModule can't compute stats (min,max,etc...) on multivalued fields
> ---------------------------------------------------------------------------
>
>                 Key: SOLR-11706
>                 URL: https://issues.apache.org/jira/browse/SOLR-11706
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Hoss Man
>
> While trying to write some tests demonstrating equivalences between the 
> StatsComponent and the JSON FacetModule i discovered that the FacetModules 
> stat functions (min, max, etc...) don't seem to work on multivalued fields.
> Based on the stack traces, i gather the problem is because the FacetModule 
> seems to rely exclusively on using the "Function" parsers to get a value 
> source -- apparently w/o any other method of accumulating numeric stats from 
> multivalued (numeric) DocValues?



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to