Our defined Type is something like this:
'title' => ... ,
'body' => ... ,
'links' => 'type'=>'object', 'properties'=> array
'link' => ... ,
'locations' => 'type'=>'object', 'properties'=> array
'label' => ... ,
'pin' => ...
)
The records/documents represent businesses that reside in one or more categories, and so the links array will contain all of the potential links to a business, i.e.
[0] => '/Businesses/Hotels/My-Business/',
[1] => '/Businesses/Resorts/My-Business/',
[2] => '/Businesses/Fractional-Ownership/My-Business/'
So when we run a query on the terms Business Resort
this listing is included in the result set. At the moment though, we don't know which link would be most appropriate to display on the results page, so we just default to the first, in this case the one with ../Hotels/..
in the path.
Is it possible to order the links according to their own score/relevancy within the search so that the link order on the returned result would instead be:
[0] => '/Businesses/Resorts/My-Business/',
[1] => '/Businesses/Hotels/My-Business/',
[2] => '/Businesses/Fractional-Ownership/My-Business/'
The order of the links should not have any influence on the order of natural results from the overall query.
EDIT : The second use case which I've added above is, we also store locations for each business, and would like to order the location list for each resulting business by their proximity to a set of coordinates. We know how to order the entire result set by _geo_distance
but need to know how to do it on a specific field, and like above, without affecting the overall result order.