ltrotta
(Laura Trotta)
July 26, 2024, 1:18pm
4
Hope it helped! If you're still having issues with aggregations here are some other examples of nested/sub aggregations:
Help Needed: Nested Aggregations with Java API Client v8
I'm working on a project using Elasticsearch with the Java API Client v8, and I'm struggling to correctly implement nested aggregations. I'd greatly appreciate any help or guidance.
Index Mapping
Here's the relevant part of my index mapping:
{
"actions" : {
"mappings" : {
"properties" : {
"actionRoles" : {
"type" : "nested",
"properties" : {
"roleName" : {
"type" : "keywor…
Hello! I've left out some details, but this is roughly how to translate that kibana query using the new java client, dsl style:
esClient.search(s -> s
.index("demo-index")
.query(q -> q
.constantScore(cs -> cs
.filter(fl -> fl
.bool(b -> b
.must(...)))))
.aggregations("datesAggName",agg -> agg
.dateHistogram(dh -> dh
…