mathpere/grails-hibernate-search-plugin — pull request #17 by jappeace (2014-01-03 17:34:29+00:00)
Title: Added hibenate 4 and hibernate-search 4 support

Hi,
I've been working on hibernate search 4.2 support for your plugin. I did this against version 2.3.3 of grails. This patch is probably not stable, but it is meant to stay on a seperate branch.

It build and within my own project I am able to search in hibernate4 with hibernate search 4.2.

To my knowing their are currently no plugins for grails that support hibernate 4, so I chose to extend your plugin, because it looked most flexible. These changes will probably be in high demand in the future as hibernate 3 support will eventualy be dropped in grails.

I've did significant changes in the `HibernateSearchGrailsPlugin` class, because of the api changes with hibernate 4. I personaly think the code is also easier to understand this way. It is for example no longer necisiary to use a callback method to get the current hibernate session.

I also added some standerd bridges, A name based bridge and a Id based bridge, I am planning to add documentation for them next week in the `README.md`.

I also add a warning that the static based mapping will probably not work as is with hibernate-search 4. This is because of several api changes, most notably the `index=tokenized` is no longer possible.

All these changes will be tested in my own project and updates will follow in the near future.

These changes should *stay on a seperate branch* because they will probably break all the hibernate 3 based code. I do not know if this pull request merges to master or not, *It should not*