How to limit mapping size?

Starting in 5.0.0 it will be possible to limit the number of fields: #17357