Sample question from a confused solr-user email...
And the subsequent followup from the same user...
I found that we can't put div(4,2) directly, as it wouldn't work.
It will work if I put something like max(div(4,2)).
It seems like a better error handline code path for FunctionQParser.parseAgg (once we've confirmed no such aggregation exists) would be:
- attempt to parse the original string as a regular (non-Agg)ValueSource) function
- if that succeeds, give the user an error indicating that this ValueSource must be wrapped in an aggregation
- if it fails, continue to throw the original error
- either way, any error thrown should refer to the original id before
- div(price,popularity) should throw an error with a msg along the lines of: 'div' is a per-document function, not a multi-document aggregation function, input: div(price,popularity)
- HOSS(price,popularity) on the other hand should throw an error such as: Unknown aggregation HOSS in ('HOSS(price,populaity)' ...
- note the message cites HOSS not agg_HOSS