Hello everybody !
I have PersonType with groupId field, which can be null, or even doesn't exist
{
Id: 1
Name : ToTo,
GroupId: 1
}
{
Id: 2
Name : TaTo,
GroupId: 2
}
{
Id: 3
Name : ToTa,
GroupId: null
}
{
Id: 4
Name : ToTo
}
{
Id: 5
Name : TaTa,
GroupId: 2
}
I need to sort them by Name and aggregate by GroupId, where if GroupId is null or doesn't exist it should be see as different group for each null
so for my example i will have :
2, 3, 1, 4
Hi ! Thanks for your reply =)
No it's not good solution for me, because i need distinct persons when they have null group, but in your solution i will aggregate 3 persons with null groupId into one bucket .
I found solution. i use the script in aggregation, which choose GroupId or -Id, like that i can cover all documents with or without GroupId
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.