For starters, get a vacuum designed for your mix of carpeting and flooring. If you have a lot of flooring to vacuum, look for models with floor attachments that use brushes and/or uprights with metal bottom plates. Make sure that the height can be set low enough and that the plate and wheels won't scratch your flooring.
For carpets, make sure the vacuum has enough suction power, especially with deep pile styles. On the other hand, there's no need for an energy hog if the situation just doesn't call for it. Make sure the height can be adjusted high enough for your needs.
If you or others in your household have long hair, get a vacuum that has a stainless steel brush roller with ball bearings. In general, metal components are better than plastic ones. Of course, they also make the unit heavier.
If keeping dust out of the air is one of your goals (and it should be), choose a bag model over a bagless one. Look for an after motor "true HEPA filter" in a "sealed system". Be aware that there's no standard that sealed models must meet.
If possible (and especially if you suffer from asthma), test air-tightness for yourself. One way is to vacuum for a bit with a floor model and then see how much dust has collected on the outside of the unit.
Try assembling and disassembling the attachments before you buy. Make sure that they're easy to assemble, that they stay together and are airtight during use, and that you can still disassemble them with minimal effort. Check the height of the fully assembled attachments to ensure that you won't be stooping or holding your arm up in the air to use them. Don't be dazzled by an array of attachments. Think about what you really need and aim for that.
Make sure that the power switch, height level controller and any other controls are easy to access and use. They'll need to be sturdy, especially if you'll be using your foot to operate them.
Make an inventory of all the parts that will require replacement, how often the replacement should occur, and how much it will cost you annually. For example, many units will need a filter, an after-filter, a bag and maybe even belt replacements within a year's time or less.
When making comparisons, compare apples to apples. The best floor sweeper in the world won't do a job as well as the worst vacuum cleaner, and an upright vacuum will handle differently than a canister. Cordless models won't match the power of one that plugs into the wall. Don't let fancy demonstrations cloud your ability to critically judge a product.