Can I search for all documents with > N children?
Let's say I've got a social network with the following mapping:
{
“users” : {
“properties” : {
“username” : {“type” : “string”, "index": "not_analyzed”},
“full_name” : {“type” : “string”},
“friends” : {
“type” : “nested”,
“properties” : {
“username” : {“type” : “string”, "index": "not_analyzed”},
“date_friended” : {“type” : “date”},
}
}
}
}
}
Can I search for all users with > 5 friends? As of right now, I'm maintaining a separate count of the children in the parent document.
Thanks in advance!