Some category organizations are flat, meaning that there's just one level. Other category organizations are hierarchical, meaning that there are top categories, subcategories, and leaf categories.
In the following example, apparel is the top category, women is the subcategory, and dresses and skirts are leaf categories:
apparel (ID cat11287000)
women (ID cat11287001)
dresses (ID cat112871001)
skirts (ID cat112872001)
Category searches use category IDs rather than the user-friendly names that your customers see in their browsers. For example, if the category, apparel, has the ID, cat11287000, then here's what the &q parameter of a category search for apparel looks like:
If your feed doesn't pass category IDs, then Commerce Categories creates them for you, based on the individual nodes in the category breadcrumb. For example, if no category IDs were set for the categories above, then Commerce Categories sets the ID for skirts as apparelwomenskirts (apparel > women > skirts).
&q=cat11287000 &fq=category:cat11287001 AND cat112872001