fixes an issue where cross-hierarchy queries (i.e. queries relating to entities with different id types and/or id property names) would fail. The fix for creates a separate Criteria object for each hierarchy present in the ids to be loaded from the database.
This conflicts though with the FullTextQuery#setCriteriaQuery() API which allows to pass in a single criteria object. One idea would be to deprecate and eventually remove setCriteriaQuery() and provide an extension point instead which allows to provide a custom criteria instance per entity type:
On a related note, org.hibernate.search.jpa.FullTextQuery#setCriteriaQuery() expects a org.hibernate.Criteria instance instead of the JPA counter-part.
Probably it'd make sense if the extension point described above works with the JPA criteria API in general, given that the Hibernate Criteria API is to be considered deprecated as per the ORM dev guide.