Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selecting facet combination from different groups enables hasSense for invalid facets #598

Closed
novoj opened this issue Jun 6, 2024 · 0 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@novoj
Copy link
Collaborator

novoj commented Jun 6, 2024

This query:

query {
  queryProduct(
    filterBy: {
      entityLocaleEquals: cs,
      attributeProductTypeInSet: ["MASTER", "SET", "BASIC"]
      attributeStatusEquals: "ACTIVE"
      hierarchyCategoriesWithin: {
        ofParent: {
          attributeUrlEquals: "/kosile"
        }
      }
      userFilter: {
        facetParameterValuesHaving: {
          entityHaving: {
            attributeCodeInSet: ["barva-zelena", "barva-ruzova", "barva-modra", "typ_tawia"]
          }
        }
      }
    }
  ) {
    recordPage {
      totalRecordCount
    }
    extraResults {
      facetSummary {
        parameterValues(
          filterGroupBy: {
            attributeCodeInSet: ["barva", "typ"]
          }
        ) {
          count
          groupEntity {
            primaryKey
            attributes {
              code
              name
            }
          }
          facetStatistics {
            requested
            count
            impact {
              matchCount
              difference
              hasSense                    
            }
            facetEntity {
              primaryKey
              attributes {
                code
                name
              }
            }
          }
        }
      }
    }
  }
}

Marks has sense in group typ for facets that would return zero results when "tawia" is deselected.

@novoj novoj added the bug Something isn't working label Jun 6, 2024
@novoj novoj added this to the Beta milestone Jun 6, 2024
@novoj novoj self-assigned this Jun 6, 2024
novoj added a commit that referenced this issue Jun 6, 2024
…hasSense for invalid facets

Has-sense needs to be computed exactly and not derived from match-count. The problematic scenario is that when user selects facets A + B, from group 1 and the has-sense is calculated as false form facet C from group 2, then when he selects facet D from group 2, the facet C from group 2 becomes having sense because it starts from the baseline of facet D which is wrong.
novoj added a commit that referenced this issue Jun 6, 2024
…n-from-different-groups-enables-hassense-for-invalid-facets

fix(#598): Selecting facet combination from different groups enables …
@novoj novoj closed this as completed Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant