Hello, Chatree.
Please check about `of` param
https://solr.apache.org/guide/solr/latest/query-guide/block-join-query-parser.html#block-mask
It's really important note.
I've made childfield() myself, so I can consult about it, but I don't know
is those _nest_path. Unfortunately I'm unaware of them.
Note, lucene query syntax uses colon to separate field:text, not =.
That {!parent} query lacks a subordinate children query, ie. it should go
after closing curly bracket } of before it via ... v='field:val'}.
Pls keep us posted if you figure out the solution.

On Sat, Nov 26, 2022 at 12:38 PM Chatree Srichart <
chatree.srich...@gmail.com> wrote:

> 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
>


-- 
Sincerely yours
Mikhail Khludnev

Reply via email to