[ 
https://issues.apache.org/jira/browse/SOLR-6328?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14087967#comment-14087967
 ] 

Hoss Man commented on SOLR-6328:
--------------------------------


Examples of the problem...

* facet.field{noformat}
$ curl -sS 
'http://localhost:8983/solr/select?facet.field=inStock&facet.missing=true&facet.limit=1&facet=true&q=*:*&rows=0&omitHeader=true&wt=json&indent=true'
{
  "response":{"numFound":32,"start":0,"docs":[]
  },
  "facet_counts":{
    "facet_queries":{},
    "facet_fields":{
      "inStock":[
        "true",17,
        null,11]},
    "facet_dates":{},
    "facet_ranges":{},
    "facet_intervals":{}}}
$ curl -sS 
'http://localhost:8983/solr/select?facet.field=inStock&facet.missing=true&facet.limit=0&facet=true&q=*:*&rows=0&omitHeader=true&wt=json&indent=true'
{
  "response":{"numFound":32,"start":0,"docs":[]
  },
  "facet_counts":{
    "facet_queries":{},
    "facet_fields":{
      "inStock":[]},
    "facet_dates":{},
    "facet_ranges":{},
    "facet_intervals":{}}}
{noformat}
* facet.pivot{noformat}
$ curl -sS 
'http://localhost:8983/solr/select?facet.pivot=manu_id_s,inStock&facet.missing=true&facet.limit=1&facet=true&q=*:*&rows=0&omitHeader=true&wt=json&indent=true'
{
  "response":{"numFound":32,"start":0,"docs":[]
  },
  "facet_counts":{
    "facet_queries":{},
    "facet_fields":{},
    "facet_dates":{},
    "facet_ranges":{},
    "facet_intervals":{},
    "facet_pivot":{
      "manu_id_s,inStock":[{
          "field":"manu_id_s",
          "value":"corsair",
          "count":3,
          "pivot":[{
              "field":"inStock",
              "value":true,
              "count":3}]},
        {
          "field":"manu_id_s",
          "value":null,
          "count":14,
          "pivot":[{
              "field":"inStock",
              "value":true,
              "count":3},
            {
              "field":"inStock",
              "value":null,
              "count":11}]}]}}}
$ curl -sS 
'http://localhost:8983/solr/select?facet.pivot=manu_id_s,inStock&facet.missing=true&facet.limit=0&facet=true&q=*:*&rows=0&omitHeader=true&wt=json&indent=true'
{
  "response":{"numFound":32,"start":0,"docs":[]
  },
  "facet_counts":{
    "facet_queries":{},
    "facet_fields":{},
    "facet_dates":{},
    "facet_ranges":{},
    "facet_intervals":{},
    "facet_pivot":{
      "manu_id_s,inStock":[]}}}
{noformat}


I discovered this while working on SOLR-2894 where i initially thought it was a 
bug specific to (distributed) pivot faceting, but later realized facet.field 
also has the same problem.  There is a commented out distributed pivot test for 
this situation in DistributedFacetPivotLargeTest as part of SOLR-2894. 
(annotated with "SOLR-6328")


> facet.limit=0 returns no counts, even if facet.missing=true
> -----------------------------------------------------------
>
>                 Key: SOLR-6328
>                 URL: https://issues.apache.org/jira/browse/SOLR-6328
>             Project: Solr
>          Issue Type: Bug
>            Reporter: Hoss Man
>            Priority: Minor
>
> facet.limit constraints the number of term values returned for a field when 
> using facet.field or facet.pivot, but that limit is (suppose) to be 
> independent of facet.missing, which adds an additional count beyond the 
> facet.limit for docs that are "missing" that field.
> This works fine for facet.limit >= 1, but if you use 
> {{facet.limit=0&facet.missing=true}} (ie: you are only interested in the 
> missing count) you get no counts at all -- not even for the missing count.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to