Closed Nix-id closed 6 years ago
Standart magento with mysql filter product correctly
i reindex all indexes and make cahce:clean cache:flush
@romainruaud : can you have a look at this one ?
Hmm....
I just spent a lot of time on your issue and initially thought I was reproducing it.
TL; DR Version : The search engine is not proceeding an exact match of the tuple on children products, but is computing a match on parent product data which is a combination of existing children values.
Detailed version :
In fact, after removing one variation, there is still one which is existing with att_3 : att3_2
. And it's even visible in your screenshot, with the id 168.
When you create a configurable product based on 3 attributes each one having 3 values, you obtain 27 variations :
+------------+------+------+------+
| product_id | att1 | att2 | att3 |
+------------+------+------+------+
| 2265 | A | AA | AAA |
| 2266 | A | AA | BBB |
| 2267 | A | AA | CCC |
| 2268 | A | BB | AAA |
| 2269 | A | BB | BBB |
| 2270 | A | BB | CCC |
| 2271 | A | CC | AAA |
| 2272 | A | CC | BBB |
| 2273 | A | CC | CCC |
| 2274 | C | AA | AAA |
| 2275 | C | AA | BBB |
| 2276 | C | AA | CCC |
| 2277 | C | BB | AAA |
| 2278 | C | BB | BBB |
| 2279 | C | BB | CCC |
| 2280 | C | CC | AAA |
| 2281 | C | CC | BBB |
| 2282 | C | CC | CCC |
| 2283 | B | AA | AAA |
| 2284 | B | AA | BBB |
| 2285 | B | AA | CCC |
| 2286 | B | BB | AAA |
| 2287 | B | BB | BBB |
| 2288 | B | BB | CCC |
| 2289 | B | CC | AAA |
| 2290 | B | CC | BBB |
| 2291 | B | CC | CCC |
+------------+------+------+------+
Let's say you delete a children, the 2290 : you will delete the B/CC/BBB tuple.
But many tuples will remain having att3=BBB
.
And since we only do index parent products, based on their children data, the parent product will still have BBB
value for att3
since it still has children with this value.
That being said, when you are filtering on :
You are refering to an unexisting tuple. That's right, and I agree that no child product matching exactly this tuple does exist.
But the parent product does match these search criterias, because it has several childrens with att1=B
, att2=CC
and att3=BBB
.
To understand better, here is what is indexed for the parent data in the search index, even after deleting the child product :
"option_text_att1": [
"A",
"C",
"B"
],
"option_text_att2": [
"AA",
"BB",
"CC"
],
"option_text_att3": [
"AAA",
"BBB",
"CCC"
],
This is a combination of all existing children values.
That's why the parent product is found when applying these filters.
=> The search engine is not proceeding an exact match of the tuple on children products, but is computing a match on parent product data which is a combination of existing children values.
So imho, there is nothing incorrect here, and we are working as expected.
Best regards, I close the issue since this is not a behavior we plan to change.
@romainruaud @afoucret
So imho, there is nothing incorrect here, and we are working as expected.
Without Elasticsuite (with mysql search) it is work different. By default, magento filters the product correctly and does not display this configuration product.
Incorrect search result in LN
Magento Version : 2.2.2
ElasticSuite Version :
Environment : ^2.5
Third party modules : none
Steps to reproduce
Expected result