Amrit Sarkar created SOLR-11159:
-----------------------------------

             Summary: Facet buckets count still incorrect even after passing 
{refine:true} | SOLR-7542
                 Key: SOLR-11159
                 URL: https://issues.apache.org/jira/browse/SOLR-11159
             Project: Solr
          Issue Type: Bug
      Security Level: Public (Default Security Level. Issues are Public)
          Components: Facet Module
            Reporter: Amrit Sarkar


I was experimenting / analysing the new *Refinement* feature in JSON Facet Apis 
introduced in SOLR-7452. Passing {{refine:true}} with the facet definition.

I am listing down the test-scenarios along with test-data:

3 sharded collection on 3 nodes
node/shard:          bucketVal - count

8987:       C - 1
8983:       C - 4       D - 1       E - 1       A - 1
8985:       E - 2       A - 1       D - 1

Total: BUCKETS
C - 5       E - 3       D - 2       A - 2

It is giving accurate results for COUNT ASC, LIMIT 1 - 4
{code}
curl http://localhost:8983/solr/collection1/select -d 
'q=*:*&json.facet={cat_s:{type:terms,field:cat_s,sort:"count 
asc",limit:1,overrequest:0,refine:true}}&wt=json&indent=true'
{code}
{code}
  "facets":{
    "count":12,
    "cat_s":{
      "buckets":[{
          "val":"A",
          "count":2}]}}}
{code}
{code}
curl http://localhost:8983/solr/collection1/select -d 
'q=*:*&json.facet={cat_s:{type:terms,field:cat_s,sort:"count 
asc",limit:2,overrequest:0,refine:true}}&wt=json&indent=true'
{code}
{code}
  "facets":{
    "count":12,
    "cat_s":{
      "buckets":[{
          "val":"A",
          "count":2},
        {
          "val":"D",
          "count":2}]}}}
{code}

*BUT, COUNT DESC, LIMIT 2 and 3*

{code}
curl http://localhost:8983/solr/collection1/select -d 
'q=*:*&json.facet={cat_s:{type:terms,field:cat_s,sort:"count 
desc",limit:2,overrequest:0,refine:true}}&wt=json&indent=true'
{code}
{code}
  "facets":{
    "count":12,
    "cat_s":{
      "buckets":[{
          "val":"C",
          "count":5},
        {
          "val":"A",
          "count":2}]}}}
{code}
{code}
curl http://localhost:8983/solr/collection1/select -d 
'q=*:*&json.facet={cat_s:{type:terms,field:cat_s,sort:"count 
desc",limit:3,overrequest:0,refine:true}}&wt=json&indent=true'
{code}
{code}
  "facets":{
    "count":12,
    "cat_s":{
      "buckets":[{
          "val":"C",
          "count":5},
        {
          "val":"A",
          "count":2},
        {
          "val":"D",
          "count":2}]}}}
{code}

*bucketVal {{E}} and its count {{3}} is not in facet response* Pardon me if I 
am missing some configuration or this behavior is right / justified. Ideally we 
should see bucketVal E and its count 3.

I am attaching Index DOCS, debugQuery for COUNT DESC, LIMIT 2 and LIMIT 3.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to