hibernate/hibernate-search — pull request #474 by Sanne (2013-09-03 13:46:50+00:00)
Title: HSEARCH-1399 Transform the MassIndexer integration from an ORM Integrato...

...r to a Search ServiceProvider

There are two alternatives:

The code in FullTextSession.createIndexer() is particularly ugly but it's the only way I could find to keep 100% backwards compatibility. The tricky aspect is that we can't pollute hibernate-search-engine with ORM specific details, nor the lookup strategy can be different to accomodate for Infinispan Query compatibility.

So I'm proposing the ugly code for now, considering it's the last iteration before 5.0

The alternative would be to simply drop the capability to plug in a custom _MassIndexerFactory_ via services and hard code our implementation to be created by the FullTextSession.createIndexer() directly, removing all the factory tricks. I like this better in its simplicity but I'd prefer the proposal below for 4.4 so that we keep compatibility for now.