Hi,
I have a requirement to group my results based on a field in child document.
Eg: In below documents, I need to group based on field “title” in child
documents.
My results should have list of parent documents and each parent document should
have child documents grouped by their title.
I didn’t find a way to group child documents in solr documentation. Can any one
help me with a solution for this?
[
{
"ID": “1",
"title": “new customers",
"content_type": "parentDocument",
"_childDocuments_": [
{
"ID": “2”,
“title": “MD”,
"comments": "Lots of new services”,
"_nest_parent_”:”1"
} {
"ID": “3”,
“title": “OD”,
"comments": "Lots of new patients”,
"_nest_parent_”:”1"
}
]
}
{
"ID": “4",
"title": “new customers",
"content_type": "parentDocument",
"_childDocuments_": [
{
"ID": “5”,
“title": “MD”,
"comments": "Lots of new services”,
"_nest_parent_”:”4”
} {
"ID": “6”,
“title": “OD”,
"comments": "Lots of new patients”,
"_nest_parent_”:”4"
}
]
}
]
Appreciate your help in advance!
Thanks,
hpotla