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

Parent products excluding children_attributes #1488

Closed
JamesAllwood opened this issue Jul 26, 2019 · 2 comments
Closed

Parent products excluding children_attributes #1488

JamesAllwood opened this issue Jul 26, 2019 · 2 comments
Assignees
Labels

Comments

@JamesAllwood
Copy link

At the moment, this is a question, not a bug.

Tested on Magento 2.3.2 and ES 2.8.1

I noticed that in one site running elasticsuite, the results in the layered navigation didn't seem correct. For example, on a particular category, there should have been around 10 results for the colour Orange.

After investigation, I looked in to the data store in elasticsearch, and could see that for the configurable product in question, it included no records for children_attributes.

"children_attributes" : [
            "indexed_attributes"
          ],

However, it did have children_ids

          "children_ids" : [
            131036,
            131037,
            131038
          ],

So, I debugged this by moving the data to a vanilla install and testing again. Same result.

I then created a new configurable product, assigning the same children, and this time, the new product included the children_attributes, but the original configurable product remained with these missing.

New product data:

          "children_ids" : [
            131036,
            131037,
            131038
          ],
          "children_attributes" : [
            "image",
            "description",
            "short_description",
            "brand",
            "option_text_brand",
            "guarantee",
            "option_text_guarantee",
            "lead_time",
            "option_text_lead_time",
            "search_colour",
            "option_text_search_colour",
            "height_adjustable",
            "option_text_height_adjustable",
            "seat_fabric",
            "option_text_seat_fabric",
            "indexed_attributes"
          ],

Old product data:

          "children_ids" : [
            131036,
            131037,
            131038
          ],
          "children_attributes" : [
            "indexed_attributes"
          ],

So, this confirms it's data related. I've checked for relationship differences, and there is nothing that I can find.

Just wondering if anyone has had similar experience, or any ideas what might be responsible

@JamesAllwood
Copy link
Author

I figured this out in the end. It seems that if the parent item has a value for an attribute, ES does not include the values of the child in the children_attributes. So, if you're also experiencing this issue, just remove the value from the configurable product, and it should all work correctly.

I'm not sure if this is a bug or intentional? Certainly the default layered navigation doesn't work in the same way, so I'm inclined to think it may be a bug.

@romainruaud
Copy link
Collaborator

Sorry for the delay on this one, but if I understand correctly, we are not merging children data into the parent data when indexing, if parent product has a value for an attribute that also exists on its children.

Or maybe we do override the children value by the parent value later in the indexing process.

@androshchuk and @serg6854 can you try to reproduce this one and to provide a fix ?

@serg6854 serg6854 assigned romainruaud and unassigned androshchuk and serg6854 Sep 18, 2019
@rbayet rbayet closed this as completed in 782f71a Oct 16, 2019
rbayet added a commit that referenced this issue Oct 16, 2019
Fixes #1488 Fixed indexing children_attributes for configurable produ…
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

4 participants