Smile-SA / elasticsuite

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

Virtual Category Rules - Cannot filter on text attribute that is not searchable #3276

Open Nuranto opened 6 months ago

Nuranto commented 6 months ago

Preconditions

Magento Version : 2.4.7

ElasticSuite Version : 2.11.6

Steps to reproduce

  1. Create/Edit a product that have tata toto tutu string in its description
  2. Edit description attribute, set "Use in search" to "No"
  3. Create/Edit a virtual category with rule : "Description contains 'toto'"

Expected result

  1. Product containing toto is found

Actual result

  1. No product is found. => We can't create a virtual rule which contains a text attribute that we don't want to use for frontend search.
rbayet commented 6 months ago

Hello @Nuranto,

Yes, contrary to what happens for numerical and select/multiselect attributes where you can have an attribute not showing in layered navigation but available in the rules through "use for promo rules = yes", this is not totally possible for non-searchable text attributes with "use for promo rules = yes".

I'll have to look at it but worst case scenario the condition is ignored or best case scenario the "contains" becomes a strict "text is equal to". For it to work, we would have to a finer grain on the application of "searchability" when generating the mapping for a text attribute :

Regards