Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-14996

Facet incorrect counts when FQ exclusion applied with collapsing

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Critical
    • Resolution: Unresolved
    • 8.6.3
    • None
    • faceting
    • None

    Description

      numFound not correct according to what is displayed in facets with exclusion when used collapsing and FQ with tag.

      Here example query:

      curl --location --request GET 'http://localhost:8981/solr/test/select?facet.field={!ex=selected}job_type&facet=on&fq={!collapse%20field=user_id}&fq={!tag=selected}job_type:thinker&q=*:*&rows=0'
      

      result is:

      {
          "responseHeader": {
              "zkConnected": true,
              "status": 0,
              "QTime": 15,
              "params": {
                  "q": "*:*",
                  "facet.field": "{!ex=selected}job_type",
                  "fq": [
                      "{!collapse field=user_id}",
                      "{!tag=selected}job_type:thinker"
                  ],
                  "rows": "0",
                  "facet": "on"
              }
          },
          "response": {
              "numFound": 850,
              "start": 0,
              "maxScore": 1.0,
              "numFoundExact": true,
              "docs": []
          },
          "facet_counts": {
              "facet_queries": {},
              "facet_fields": {
                  "job_type": [
                      "runner",
                      220,
                      "developer",
                      202,
                      "digger",
                      202,
                      "thinker",
                      195,
                      "ninja",
                      181
                  ]
              },
              "facet_ranges": {},
              "facet_intervals": {},
              "facet_heatmaps": {}
          }
      }
      

      as you can see there FQ with

      {!tag=selected}job_type:thinker
      

      and facets with

      {!ex=selected}job_type
      

      in results I see for thinker 195, but numFound is 850.

      Expected:
      thinker 195, numFound is 195
      or
      thinker 850, numFound is 850

      You can use this simple project to reproduce the issue https://github.com/Hronom/solr-cloud-basic-auth/tree/main/solr-cloud-playground-collapsing

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            Hronom Yevhen Tienkaiev

            Dates

              Created:
              Updated:

              Slack

                Issue deployment