lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jinyi Lu <jin...@vmware.com>
Subject Sort with subquery
Date Mon, 27 Nov 2017 21:39:08 GMT
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
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message