Re: Facet Range by Distance generating count of field - need sum of the field

2020-01-10 Thread Paras Lehana
Hi Robert,

How does this work?

{!frange l=0 u=5} sum(geodist())



On Fri, 3 Jan 2020 at 21:10, Robert Scavilla  wrote:

> Thank yo in advance for your help.
>
> I need to get the sum of a pivot range field. The following query uses the
> stats function to sum the *sumField* values. I'm trying to sum the same
> field in a frange subquery and I don't know how.
>
>
> /select?defType=edismax=*:*={!geofilt}=totalResultsUsers,_dist_:geodist(),score=geodist()
>
> desc=true=0=-1=1=value=true=miles=json=dId:193=Coordinates=40.243919,-74.753489=5={!tag=t1}sumField={!stats=t1}startDate=startDate:[2019-12-01
> TO *]={!frange l=0 u=5}geodist()={!frange l=5.001
> u=10}geodist()
>
> This query produces the following results:
>
>   "facet_counts":{
> "facet_queries":{
>   "{!frange l=0 u=5}geodist()":27,
>   "{!frange l=5.001 u=10}geodist()":0},
> "facet_pivot":{
>   "startDate":[{
>   "field":"startDate",
>   "value":"2019-12-01",
>   "count":27,
>   "stats":{
> "stats_fields":{
>   "users":{
> "min":1.0,
> "max":158.0,
> **"count":27,
> "missing":0,
> "sum":488.0,
> "sumOfSquares":40848.0,
> "mean":18.074074074074073,
> "stddev":35.09758475793535]}},
>
>
> 
>
> What I'm going for is line: "*{!frange l=0 u=5}geodist()":27* should be
> 488.0 which is the sum of the field as opposed to 27 which is the count of
> the field.
>
> Thank you!
>


-- 
-- 
Regards,

*Paras Lehana* [65871]
Development Engineer, Auto-Suggest,
IndiaMART Intermesh Ltd.

8th Floor, Tower A, Advant-Navis Business Park, Sector 142,
Noida, UP, IN - 201303

Mob.: +91-9560911996
Work: 01203916600 | Extn:  *8173*

-- 
*
*

 


Facet Range by Distance generating count of field - need sum of the field

2020-01-03 Thread Robert Scavilla
Thank yo in advance for your help.

I need to get the sum of a pivot range field. The following query uses the
stats function to sum the *sumField* values. I'm trying to sum the same
field in a frange subquery and I don't know how.

/select?defType=edismax=*:*={!geofilt}=totalResultsUsers,_dist_:geodist(),score=geodist()
desc=true=0=-1=1=value=true=miles=json=dId:193=Coordinates=40.243919,-74.753489=5={!tag=t1}sumField={!stats=t1}startDate=startDate:[2019-12-01
TO *]={!frange l=0 u=5}geodist()={!frange l=5.001
u=10}geodist()

This query produces the following results:

  "facet_counts":{
"facet_queries":{
  "{!frange l=0 u=5}geodist()":27,
  "{!frange l=5.001 u=10}geodist()":0},
"facet_pivot":{
  "startDate":[{
  "field":"startDate",
  "value":"2019-12-01",
  "count":27,
  "stats":{
"stats_fields":{
  "users":{
"min":1.0,
"max":158.0,
**"count":27,
"missing":0,
"sum":488.0,
"sumOfSquares":40848.0,
"mean":18.074074074074073,
"stddev":35.09758475793535]}},




What I'm going for is line: "*{!frange l=0 u=5}geodist()":27* should be
488.0 which is the sum of the field as opposed to 27 which is the count of
the field.

Thank you!