Hi,

I have the following odd behavior on my queries. I'm using group result
using the group feature of solr. The problem is that when using the default
sort=score desc the result is as expected. But when I changed it to
sort=score asc the result is not what I expected. Below are the details of
my data.

Some Index with a tokenized text field holding keywords

postID, text

Here is the first query using score=sort asc

http://localhost:8983/solr/core/select?omitHeader=true&fl=*,score&group.field=groupId&group.format=simple&group.limit=1&group.main=false&group.ngroups=true&group.sort=score
desc&group.sort=score desc&group=true&indent=on&q=text:cars&sort=score
asc&start=0&rows=10&wt=json

and here is the result:
{
  "grouped":{
    "partnerId":{
      "matches":3102,
      "ngroups":6,
      "doclist":{"numFound":3102,"start":0,"maxScore":0.984928,"docs":[
          {
            "postId":"29625",
            "score":0.1723624},
          {
            "postId":"19846",
            "score":0.9239444},
          {
            "postId":"18228",
            "score":0.984928},
          {
            "postId":"23992",
            "score":0.3939712},
          {
            "postId":"10115",
            "score":0.24375725},
          {
            "postId":"33499",
            "score":0.92819995}]
      }}}}

and here is the scond query with sort=score desc

http://localhost:8983/solr/core/select?omitHeader=true&fl=*,score&group.field=groupId&group.format=simple&group.limit=1&group.main=false&group.ngroups=true&group.sort=score
desc&group.sort=score desc&group=true&indent=on&q=text:cars&sort=score
desc&start=0&rows=10&wt=json

{
  "grouped":{
    "partnerId":{
      "matches":3102,
      "ngroups":6,
      "doclist":{"numFound":3102,"start":0,"maxScore":0.984928,"docs":[
          {
            "postId":"18228",
            "score":0.984928},
          {
            "postId":"33499",
            "score":0.92819995},
          {
            "postId":"19846",
            "score":0.9239444},
          {
            "postId":"23992",
            "score":0.3939712},
          {
            "postId":"10115",
            "score":0.24375725},
          {
            "postId":"29625",
            "score":0.1723624}]
      }}}}

As you can see the order is not as expected. I expected the group order
should be the reverse of the first query result. Is this normal?

Thank You

Best Regards

Reply via email to