indexer: model auto-generation

This is a little part from #2587 that makes the code base smaller.

Signed-off-by: Jiri Kuncar <jiri.kuncar@cern.ch>