Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Not A Bug
-
None
-
None
-
None
Description
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
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'
"facets":{ "count":12, "cat_s":{ "buckets":[{ "val":"A", "count":2}]}}}
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'
"facets":{ "count":12, "cat_s":{ "buckets":[{ "val":"A", "count":2}, { "val":"D", "count":2}]}}}
BUT, COUNT DESC, LIMIT 2 and 3
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'
"facets":{ "count":12, "cat_s":{ "buckets":[{ "val":"C", "count":5}, { "val":"A", "count":2}]}}}
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'
"facets":{ "count":12, "cat_s":{ "buckets":[{ "val":"C", "count":5}, { "val":"A", "count":2}, { "val":"D", "count":2}]}}}
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.
Attachments
Attachments
Issue Links
- is related to
-
SOLR-7452 json facet api returning inconsistent counts in cloud set up
- Resolved