We're updating the issue view to help you get more done. 

HSQuery.targetedEntities(List<Class<?>>) won't always work when using multiple backends

Description

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)
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.

Environment

None

Status

Assignee

Yoann Rodière

Reporter

Yoann Rodière

Labels

None

Suitable for new contributors

None

Feedback Requested

None

Components

Fix versions

Affects versions

5.6.0.Beta2

Priority

Major