In game, as well as selecting soldiers by barracks flag, you can select soldiers by type (infantry, archers, cavalry) by using the F6, F7, and F8 keys. If you have no soldiers currently highlighted, this selects all units of this type, no matter where they are on the map. If you already have a bunch of units selected, however, it only picks the subset of that type from those already selected.
This works well for infantry and cavalry. However, it does not work for archers. F7 (and the corresponding button) always selects all archers everywhere, even if I’m currently selecting just a small group. This is a pain, because I often want to move back the archers in a mixed infantry-archer group back without moving every single archer on the map to that location.
As a slight aside, if we could split the “infantry” selection button into light / heavy / pikes (or just sword vs pikes) it would be great. Very hard to make specific use of pikes against cavalry without this (or making pike-only barracks, which has its own problems).