What is the best vacuum cleaner for hardwood floors and carpet?

Our very old and faithful Dyson vacuum sadly gave in and stopped working after about 25 years. Our local vacuum cleaner shop would not even look at it. It's time to move on and find a replacement.
We are not very informed about new vacuum cleaners. What are the best vacuum cleaner brands and options these days? Do you recommend upright or canister ones? What about bagless vs bagged? We do have quite a lot of hardwood floors and carpet, so we'd need something good for that.
I've googled around a bit and The Wirecutter recommends Miele Dynamic U1 Twist, while Get Cleaning Done recommends a vacuum that's supposed to be specifically good for hardwood floors, Shark Navigator Lift-Away. What do you think about these two options?
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
Add image file

HomeOwnersHub.com is a website for homeowners and building and maintenance pros. It is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.