The definition of samurai and farmers were not so clear before the sword hunt decree (the disarmament of farmers) of 1588 by Hideyoshi and the residence zoning for samurai in castle towns, for townspeople in cities, and for farmers in rural villages, and those measures separated the samurai class and the farmer class definitely.
それまで武士と農民は分離していなかったが、豊臣秀吉の刀狩りと武士は城下・町人は町屋・農民は村落と住居が固定されるなどにより武士階級と農民が明確に分離された。