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

Facets with Language #35

Open
philip-elevated opened this issue May 6, 2020 · 2 comments
Open

Facets with Language #35

philip-elevated opened this issue May 6, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@philip-elevated
Copy link

I am using the language specification in my query just fine and the results are as expected. However, the facets still return items in all languages. Is there a way to adhere the language specification to the facets?

My query

query {
  searchAPISearch(
    index_id: "content"
    range: {offset: 0, limit: 25}
    language: "en"
    facets: [
      {operator: "=", field: "product", limit: 0, min_count: 0, missing: false}
    ]
  ) {
    result_count
    documents {
      ... on ContentDoc {
        nid
        url
        title
        product
        type
        version
        langcode
      }
    }
    facets {
      name
      values {
        count
        name: filter
      }
    }
  }
}
@philip-elevated
Copy link
Author

And here are some of the facet results from that query

{
              "count": 0,
              "name": "promote"
            },
            {
              "count": 0,
              "name": "server"
            },
            {
              "count": 0,
              "name": "アルテリクス分析ハブ"
            },
            {
              "count": 0,
              "name": "产品激活和许可"
            },
            {
              "count": 0,
              "name": "开发人员帮助"
            },
            {
              "count": 0,
              "name": "机器学习"
            },

@duartegarin
Copy link
Collaborator

Hi @philip-elevated ,
Sorry about the embarassingly late reply.
We could potentially update the SearchAPIFacets to achieve this, adding filtering on a language basis.
I can have a look at this as soon as possible, but I'm otherwise open to a PR here.

@carolpettirossi carolpettirossi added the enhancement New feature or request label Mar 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants