query: {
query_string: {
query: 'type: message',
analyze_wildcard: true
}
},
size: 1000,
_source: {
excludes: []
},
aggs: {
user: {
terms: {
field: 'content.username.keyword',
size: 1000,
order: {
_count: 'desc'
}
},
aggs: {
channel: {
terms: {
field: 'channelId.keyword',
size: 1,
order: {
_term: 'desc'
}
},
aggs: {
messages: {
terms: {
field: 'content.message.keyword',
size: 5,
order: {
_count: 'desc'
}
},
aggs: {
sentiment: {
terms: {
field: 'sentimentScore',
size: 5,
order: {
_term: 'desc'
}
}
}
}
}
}
}
}
}
}
This query return aggregations empty even with 117 hits