Zend certified PHP/Magento developer

Search / Layered Navigation – How is Magento dealing with grouped/configurable/options and their children?

I am trying to understand why in the core Magento functionality search and layered navigation are fine returning parent products when children are a match, but why so many extensions fail to do so.

I can see that at index creation the child products of any product with “links” are added to the index.

I have gone through the main classes called when building a Product List, I have trawled through anything I could see around Layers and Product Links and I can’t quite see how it all comes together at the end to put parent products as a result.

I have gone from MagentoCatalogBlockProductListProduct.php MagentoCatalogModelLayerResolver.php MagentoCatalogModelLayer.php MagentoCatalogModelLayerContext.php MagentoCatalogModelLayerFilterList.php and trawled further through filters, collections and product links code.

I still can’t quite figure out how it all fits together and at which point the “matches in simple products become matches in the parent” magic happens.

It has to be something that happens in the flow of search and layers that is not an obvious step in the normal collection building and filtering.

Anyone looked into this at some point and can shed some light?