Where is the code snippets of searching products associated with this category in Search Index?

There is a 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.

User could choose the manufacturer, and then it will saved in customersession.

$customerSession->setMyValue(array(‘mId’ => ‘1;’ )

When user click a category on home page to open the category page, the page only show the products filtered by mid.

As far as I know, magento 2 try to get the products ids first from the elastic search, then get products form mysql by ids.

010d-283x1024

My thought is try to find where magento 2 get the products ids in 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 is the code snippets of searching products associated with this category in Search Index?