| I think this is even more relevant now that we offer the ability to use Elasticsearch for indexing, meaning applications are more likely to need to scale. Maybe we could try to use ORM [filters](http://docs.jboss.org/hibernate/orm/5.3/userguide/html_single/Hibernate_User_Guide.html#mapping-column-filter)? Those allow to filter entities that will be loaded in a given session, and they can be parameterized. We'd have to investigate how they can fit in the mass-indexing process, though: I think we load IDs first, and I don't know if filters can be applied when loading just IDs. We also would have to check whether these filters are applied to indirect loading (through associations), which would not be desirable in our case. |