But the user might need to read other fields from the object to make a decision.
The engine does not (currently) provide a way of presenting a Lucene Document to the IndexShardingStrategy in order for the user to read fields from it. I imagine it'd need to recreate it on the fly in order for that to work, which implies reading the index?
May I guess you're looking at it with eyes of performance optimisation, as the current implementation sends delete operations to all shards?
This is one nice side effect, but the real reason is that I have a sharded and shared index across nodes, and each node has its own index managers opened, and each node should delete from its own shards. Also, coming back to the initial suggestion, using org.hibernate.search.store.ShardIdentifierProvider.getShardIdentifier for deletes would not work when deleting by type with FullTextSession.purgeAll: the shard provider should return a Set of shards instead of one. |