Hello all,

I have these 2 parent documents and each of them has 2 children with
different nest paths (/path1, and /path2)

[
{
"id": "parent_1",
"children": [
{
"id": "child_1.1",
"field": "value 1.1",
"_nest_path_": "/path1#"
},
{
"id": "child_1.2",
"field": "value 1.2",
"_nest_path_": "/path2#"
}
]
},
{
"id": "parent_2",
"children": [
{
"id": "child_2.1",
"field": "value 2.1",
"_nest_path_": "/path1#"
},
{
"id": "child_2.2",
"field": "value 2.2",
"_nest_path_": "/path2#"
}
]
}
]


My question is:

How to sort the parent documents by a field of a child document with
specific _nest_path?

I see this in the Solr document:

sort=childfield(field,{!parent of=…}…) desc allows to inline block join
parent query


*childfield(field) Function*
https://solr.apache.org/guide/8_11/function-queries.html

However, I don't know what the of=... should be.

I have already tried this:

childfield(field,{!parent of='_nest_path_=/path1'}) desc

but I always get this error:

*Can't determine a Sort Order (asc or desc) in sort spec ...*

Best regards,
Chatree Srichart

Reply via email to