Many years ago I bought 2 acres from a farmer who raised cows. We had a very enjoyable 12 years there. We had great neighbors. Yes, we had a 2 to 4 days each year that we could smell the natural fertilizer being spread, when the wind was blowing in the right direction. No big deal. 363 days had air quality so pure you can't find it anywhere in the city. We also had unchlorinated water that contained natural calcium. The worst noise pollution was on the very hot nights when we were trying to sleep. Boy, the crickets can be loud!
My advice to the anyone buying a house near a farm is to perform due diligence. Think about it. If a couple of days of odor will ruin your life, don't buy near a farm. For all others, I say, enjoy! If life hadn't interfered, we would still be in that house and on that land.