No way. Subquery processes a cropped page of docs sorted before. Giving the subquery, you can use {!join score=Max ...}... see http://blog-archive.griddynamics.com/2015/08/scoring-join-party-in-solr-53.html
On Tue, Nov 28, 2017 at 12:39 AM, Jinyi Lu <jin...@vmware.com> wrote: > Hi all, > > I have a question about how to sort results based on the fields in the > subquery. It’s exactly same as this question posted on the stackoverflow > https://stackoverflow.com/questions/47127478/solr-how- > to-sort-based-on-subquery but no answer yet. > > Basically, I have two collections: > > 1. Static data like the information about the objects. > { > "id": "a", > "type": "type1" > } > > 1. Status about the objects in the previous collection which will be > frequently updated. > { > "object_id": "a", > "cnt": 1 > } > > By using queries like q=id:*&fl=*,status:[subquery]&status.q= > status.q={!term f=object_id v=$row.id}, I am able to combine two > collections together and the response is something like: > [{ > "id": "a", > "type": "type1" > "status":{"numFound":1, "start":0, "docs":[ > { > "object_id": "a", > "cnt": 1 > }] > } > }, > …] > > But is there a way to sort the results based on the fields in the > subquery, like "cnt" in this case? Any ideas are appreciated! > > Thanks! > Jinyi > -- Sincerely yours Mikhail Khludnev