I installed a fresh magento2, and top categories are working, but for sub-category, there is no product showing up in frontend even thought I assigned products to these sub-categories.
It's always said "We can't find products matching the selection."
Where can I find the code in Magento 2 that's responsible for displaying products so I can diagnose this in a programatic manner?
To show the product, check if the product following options:
If you want checking product to subcategory, go to Catalog->Manage Categories->Select your category, open tab Display Settings and change option "Is Anchor" to "Yes". Save category.