elasticsuite
elasticsuite copied to clipboard
Virtual Category Rules - Cannot filter on text attribute that is not searchable
Preconditions
Magento Version : 2.4.7
ElasticSuite Version : 2.11.6
Steps to reproduce
- Create/Edit a product that have
tata toto tutu
string in its description - Edit description attribute, set "Use in search" to "No"
- Create/Edit a virtual category with rule : "Description contains 'toto'"
Expected result
- Product containing toto is found
Actual result
- 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.
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