Get doc _parent value in sort script

I have parent/child relation, and i want to access to _parent field in sort script.
It is possible?

    It's body on php
        
    'body' => [
        'from' => $offset,
        'size' => $size,
        'sort' => [
            '_script' => [
                'script' => 'doc._parent', - how can i get _parent value of document?
                'type'   => 'number',
                'order'  => 'desc'
            ]
        ],
        'query' => some query
    ]
    
    Thanks

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.