Smile-SA / elasticsuite

Smile ElasticSuite - Magento 2 merchandising and search engine built on ElasticSearch
https://elasticsuite.io
Open Software License 3.0
762 stars 341 forks source link

GraphQl - can't filter product without making it searchable #2079

Closed altie33 closed 3 years ago

altie33 commented 3 years ago

Hello, I have an issue with the graphql product api. In order to make an attribute filterable, i'm forced to make is searchable in the back office ( is_searchable = 1 ). But i don't necessary want my attributes to be searchable. I think we should be able to filter when we change the value of "is_filterable" or "is_filterable_in_search"

Preconditions

Magento Version : EE 2.3.4

ElasticSuite Version : 2.8.9

Environment : both

Third party modules :

Steps to reproduce

  1. Go on the configuration of a product attribute of select type in the BO. Make sure "use in search" is at "NO", and "Use In Layered Navigation" to "Filterable (no results) and "Use In Search Results Layered Navitation" to "YES"
  2. Clean cache and reindex all
  3. Make the graphl request, trying to filter with the attribute you put filterable
{
  products(currentPage: 1, pageSize: 150,
    filter: {material: {eq: "Fleeco"}}, 
    sort: {price: ASC}) {
    total_count
    page_info {
      page_size
      current_page
      total_pages
    }
    items {
      name
      id
      sku
    }
    aggregations {
      options {
        count
        label
        value
      }
      attribute_code
      count
      label
    }
  }
}

Expected result

  1. The request should work, i should have my products results matching with the condition

Actual result

{
  "errors": [
    {
      "message": "Field \"material\" is not defined by type ProductAttributeFilterInput.",
      "extensions": {
        "category": "graphql"
      },
      "locations": [
        {
          "line": 3,
          "column": 14
        }
      ]
    }
  ]
}
romainruaud commented 3 years ago

@vahonc can you start by trying to reproduce this issue on latest versions ?

vahonc commented 3 years ago

Hello all,

I tried to reproduce this issue on the latest version of ElasticSuite (2.10.3) and with Magento 2.4.2 EE and didn't notice any errors with the graphql product API. I also tried to test it on ElasticSuite 2.9.3 and Magento 2.3.5.p2 EE and there is also everything is fine with graphql. In the end, I was only able to reproduce this issue with the ElasticSuite 2.8.6 and Magento 2.3.4 CE/EE, but @altie33, as you probably know, we don't support the old version for free so you should contact with @romainruaud by email for paid support.

BR, Vadym

romainruaud commented 3 years ago

I close this one for being related to a deprecated/unmaintained version.

Regards