| It seems we have a API design issue with the introduction of QueryDescriptor. The QueryDescriptor implementation defines which backend will be used for a query (there's an implementation for each backend). Thus it's created based on which entities we're targeting (in org.hibernate.search.engine.impl.ImmutableSearchFactory.createQueryDescriptor(Query, Class<?>...)). But: 1. These targeted entities are just used for backend determination, and not saved for use on query execution (see
HSEARCH-2367 Pull Request Sent ) 2. (that's the issue to address here) The HSQuery interface allows for later change of the targeted entities... Which could then be entities that are indexed in another backend. This would probably fail miserably at some point. |