When mass indexing an entity containing an @IndexedEmbedded *-to-one association which only includes the associated id into the index, fetching the associated entity from the database is not needed. So we can optimize that particular case.
More specifically, the unproxying in o.h.s.engine.spi.DocumentBuilderIndexedEntity.buildDocumentFields() should happen in a smarter way, i.e. it should not be done if all we need is the id and we can get it from the proxy.
Closing this ticket, we'll address the problem in HSEARCH-3100.