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

[Facet] Facet coverage rate not taken into account on the category page #1185

Closed
trivallain opened this issue Nov 15, 2018 · 2 comments
Closed
Assignees
Labels

Comments

@trivallain
Copy link

On the category page, all facets are display, even attributes with only 10% of coverage rate (Facet coverage rate parameters to 90).

Preconditions

Magento Version : 2.2.5 EE
ElasticSuite Version : 2.5.15
Environment : Developer mode

Steps to reproduce

  1. Add several products to a category
  2. Set black value to color attribute's on only one product

Expected result

  1. Color facet is not display

Actual result

  1. Color facet is display

vendor/smile/elasticsuite/src/module-elasticsuite-catalog/Model/Layer/RelevantFilterList.php
$coverageRates = $this->getCoverageRates($productCollection);
In $coverageRates, all the attributes value are set to 100.

@romainruaud
Copy link
Collaborator

Hello @trivallain

How are your indexes configured ? Can you check how the products look like in the Elasticsearch index directly ?

Regards

@romainruaud
Copy link
Collaborator

Ok, so we probably found what is responsible of this one during a live coding session :

  • products are having a null value for the color attribute.

null values are removed by this line when preparing them : https://github.com/Smile-SA/elasticsuite/blob/master/src/module-elasticsuite-catalog/Model/Product/Indexer/Fulltext/Datasource/AttributeData.php#L91

BUT, on this next line, we keep adding the attribute_code into the special indexed_attributes field which is used for computing coverage : https://github.com/Smile-SA/elasticsuite/blob/master/src/module-elasticsuite-catalog/Model/Product/Indexer/Fulltext/Datasource/AttributeData.php#L101

This leads to having a product in the index without the color field, but having it inside indexed_attributes.

So, for now, a quick workaround is to prevent/remove these null values in the DB, which should be enough to have correct coverage.

By our side, we'll ensure being more restrictive with the data we put into the indexed_attributes field for indexing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants