-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Inner .Aggregations() with .Sum() can't get "Sum" values #1079
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Try to do it with |
@Dem0n2die4 I can't quite reproduce this. Either I don't understand the issue entirely, or it may have something to do with your data? Would you mind taking a look at this test and see if you can get it to fail? |
ok, thx, I'll try it later) |
Test works fine. |
The only difference in histogram field type. It's Int, not DateTime. |
Yep, if "StartedOn" replace with "IntValues" then there is an exception |
@Dem0n2die4 thanks for looking at the test. I was able to confirm the same thing, getting a This seems to be different issue than the error you were encountering though? What is the data type of your |
It's
it'll work perfect. Don't know whether it's different issue or not. But inner aggregation is |
Maybe I doing something wrong, but |
@Dem0n2die4 I was able to get to the bottom of this. The problem was that inner aggregations were totally ignored when converting from Just pushed the fix above; thank you for reporting this. 👍 |
Thx for help) |
Hello. Use nest 1.2.2 with elastic 1.3.2.
Do this request:
var histogram = client.Search( s => s
.Query( q => q.
.Filtered( qf => qf
.Query( qq => qq.MatchAll())
.Filter( f => f.Range( r => r.OnField( rf => rf.Time).Greater(from).Lower(to)))
)
)
.Aggregations( a => a.Histogram("hist", h => h.Field(f => f.Time)
.Interval(3000)
.Aggregations( agg => agg
.Sum("sizes", aggs => aggs.Field(sf => sf.Size))
)
)
);
If I do this request manualy response looks like:
{
"key": 1417168800,
"doc_count": 28,
"sizes": {
"value": 900
}
},
{
"key": 1417172400,
"doc_count": 21,
"sizes": {
"value": 1228
}
},
Don't understand what is wrong with it. Can You help me?
The text was updated successfully, but these errors were encountered: