elasticsuite icon indicating copy to clipboard operation
elasticsuite copied to clipboard

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

Open Nuranto opened this issue 9 months ago • 1 comments

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.

Nuranto avatar May 13 '24 12:05 Nuranto

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 :

  • if the (text) attribute is EITHER use for promo rules = yes OR searchable = YES, then add the correct field structure in the index to allow fulltext search
  • ONLY if the (text) attribute has searchable = YES then add the "copy_to" instructions to copy the data to the collector fields (search, spelling, reference, etc...)

Regards

rbayet avatar May 14 '24 08:05 rbayet