Term Stats Facet for Array of Fields showing Wrong Total


(vijuitech) #1

Hi,
I am using the Term stats Facet for getting the Total for
the set of Prominence values of different stake ID in Array of
fields.

"fields" : {
"stakedetailsarray.stakeprominence" : [ 30.83, 30.83, 30.83,
30.83 ],
"stakedetailsarray.stakeid" : [ 1, 6, 8, 9 ],
}

"fields" : {
"stakedetailsarray.stakeprominence" : [ 30.83, 30.83 ],
"stakedetailsarray.stakeid" : [ 1, 6 ],
}

"fields" : {
"stakedetailsarray.stakeprominence" : [ 38.33, 30.83, 46.0,
30.83 ],
"stakedetailsarray.stakeid" : [ 1, 4, 5, 7 ],
}

"fields" : {
"stakedetailsarray.stakeprominence" : [ 24.17, 24.0, 24.17 ],
"stakedetailsarray.stakeid" : [ 4, 5, 7 ],
}

"fields" : {

    "stakedetailsarray.stakeprominence" : [ 24.17, 24.0, 24.17 ],
    "stakedetailsarray.stakeid" : [ 4, 5, 7 ],

}
"fields" : {

   stakedetailsarray.stakeprominence" : [ 31.67, 24.0, 24.17 ],
    "stakedetailsarray.stakeid" : [ 1, 5, 6 ],

}

:
:
"facets" : {
"common" : {
"_type" : "terms_stats",
{
"term" : 7,
"count" : 3,
"total_count" : 7,
"min" : 24.0,
"max" : 46.0,
"total" : 211.5,
"mean" : 30.214285714285715
}, {
"term" : 6,
"count" : 3,
"total_count" : 5,
"min" : 24.0,
"max" : 31.67,
"total" : 141.5,
"mean" : 28.3
},

In this I got the Count as correct value . The Total Value is getting
wrong,

The total for term 6 is 85.83, but it is showing as 141.5.

The total for term 7 is 79.17, but it is showing as 211.5.

How can I get the correct total for the Terms?

--


(system) #2