Shard filtering doesn't work with Elasticsearch queries

Description

It is supposedly possible to filter by shard in queries by using a specific ShardIdentifierProvider that would implement org.hibernate.search.store.ShardIdentifierProvider.getShardIdentifiersForQuery(FullTextFilterImplementor[]) in such a way that some filters would be interpreted as shard filters.
See org.hibernate.search.test.sharding.LogRotationExampleTest.filtersTest(), and more specifically org.hibernate.search.test.sharding.LogRotationExampleTest.LogMessageShardingStrategy.getShardIdentifiersForQuery(FullTextFilterImplementor[]) for an example.

When using Elasticsearch, though, such filtering doesn't work. org.hibernate.search.test.sharding.LogRotationExampleTest.filtersTest(), in particular, fails.

The main issue is that org.hibernate.search.store.ShardIdentifierProvider.getShardIdentifiersForQuery(FullTextFilterImplementor[]) seems to be ignored in org.hibernate.search.elasticsearch.impl.ElasticsearchHSQueryImpl.
LuceneHSQuery takes it into account in org.hibernate.search.query.engine.impl.LuceneHSQuery.getIndexManagers(EntityIndexBinding) when it calls org.hibernate.search.store.IndexShardingStrategy.getIndexManagersForQuery(FullTextFilterImplementor[]).

Note: some tests have been disabled because of this bug. Please search for this ticket's code (HSEARCH-2477) in the source and re-enabled the tests when the issue has been fixed.

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

Priority

Major