This query is supported by the parallel SQL interface (
https://cwiki.apache.org/confluence/display/solr/Parallel+SQL+Interface)

If you specify aggregationMode=facet it will use the json facet API under
the covers to get the result. There are more details about aggregation
modes in the docs. The Having clause is implemented in the SQL handler
though, not in the json facet API.

Joel Bernstein
http://joelsolr.blogspot.com/

On Fri, Mar 10, 2017 at 12:55 PM, lazarusjohn <lazarusj...@gmail.com> wrote:

>
> Is it possible to get average of amount between two values(min and max
> specified) in solr JSON Facet API results?
>
> Ex: here is the query i need to apply in Solr
>
> SELECT STATE, AVG(AMOUNT) from Table group by STATE having AVG(AMOUNT) >
> 3000 AND AVG(AMOUNT) < 5000
>
> currently i am getting avg amounts using following query in Solr. I would
> like to add min and max limits to get only average values between min and
> max values.
>
> { "e_name": { "type": "terms", "field": "STATE", "mincount": 1, "offset":
> 0,
> "limit": 10, "sort": { "AMOUNT": "desc" }, "facet": { "AMOUNT":
> "avg(AMOUNT)" } } }
>
>
>
>
> --
> View this message in context: http://lucene.472066.n3.
> nabble.com/Solr-Json-APi-aggregation-specifiy-min-and-
> max-values-tp4324342.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Reply via email to