Your line of thinking is certainly right. The shorter the length to maturity, the less impact interest rates will have on the price of the bond. If rates rise, a 20 year bond has a long way to go until it matures, where a 5 year bond doesn't.
Obviously floating/real return bonds take away a key risk, in fact arguably the biggest risk with bonds, and that is inflation/interest rates. However, you will need to understand that these products offer less of a premium. There is always a give/take proposition in these types of products. Yes, you're protected against rates rising because of the fact your coupon rate will rise as well. However, you'll get a much smaller coupon to begin with.
But as I mentioned at the start, your line of thinking is right. Many investors during a rising rate or rumored rising rate environment will head to floating rate bonds to protect themselves and reduce risk.