To my surprise, it took over 5 years after I bought my Bechstein grand to knock the first ivory off - some of them are clearly a little loose but stay in place. When one did get knocked off I scratched my head over how best to fix it, and settled on silicone sealant, which has been entirely successful so I thought I would share the tip.
Yes, this is exactly the stuff sold as bath sealant. But it's used in industry quite a lot as a general-purpose glue and it will stick just about anything, with a lifetime of decades unless it gets mouldy (which it won't under a keytop). It's white (other colours are available but you have to look hard for them) and is a paste when it's applied, so you need to apply steady and even pressure across the keytop and wipe off the excess which will squeeze out around the edges. You've got plenty of time to ensure the fit is correct - it takes a few hours to set. If you ever need to get the keytop off, just slide a knife gently underneath and the silicone will slowly and gracefully give way.
Another tip is that you don't even need to remove the action from the piano. You do need to take off the fall board, and the little wooden bar behind it which stops the keys coming up too high, then lift the key up a few cm so you can get the bottom end of a G-clamp underneath it. I was particularly keen on this because although it's easy to get the Bechstein action out, removing a key is much harder than on more recent pianos (mine was made in 1889).