There is an attribute named mid, the value is like ‘1; 2; 3;’, which means a product maps to many manufacturers. To keep the solution simple, we put it in the text field.
Users could choose the manufacturer, and then it will be saved in customersession.
$customerSession->setMyValue(array('mId' => '1;' )
When the user clicks a category on the home page to open the category page, the page only shows the products filtered by mid.
As far as I know, Magento 2 tries to get the products ids first from the elastic search, then get products from MySQL by ids.
My thought is to try to find where Magento 2 gets the products ids on the category page. So I can try to put a filter in filterbuilder, but I haven’t found the code snippets yet.
Please help me, where are the code snippets of searching products associated with this category in the Search Index?