Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade to handle grails 5 and hibernate 5.5 #47

Open
olliefreeman opened this issue Oct 11, 2021 · 10 comments
Open

upgrade to handle grails 5 and hibernate 5.5 #47

olliefreeman opened this issue Oct 11, 2021 · 10 comments

Comments

@olliefreeman
Copy link
Contributor

Grails 5 will release with a dependency on hibernate 5.5 which hibernate search does not support at the current version.
https://hibernate.org/search/releases.

We therefore need to update to hibernate search 6

@olliefreeman
Copy link
Contributor Author

I have started work on this locally as it requires updating to hibernate search 6 and lucene 8. Has anyone else started work on this??

@lgrignon
Copy link
Collaborator

Not on my side, sorry

@olliefreeman
Copy link
Contributor Author

olliefreeman commented Oct 11, 2021

for anyone interested the work is here https://github.com/olliefreeman/grails-hibernate-search-plugin/tree/feature/update-to-hibernate-search-6

I will submit PR once its ready, i will be testing this against our main project which uses most of the existing features.

Any requests for missing features please add information here and i will endeavour to add them

@olliefreeman
Copy link
Contributor Author

The readme and grails page will need some decent updating as per https://docs.jboss.org/hibernate/search/6.0/migration/html_singl to help people migrate

@olliefreeman
Copy link
Contributor Author

I'm hoping i can backstep grails and hibernate core to work with grails 4, but that depends

@olliefreeman
Copy link
Contributor Author

backstepping will work for grails 4 however at this point we need https://hibernate.atlassian.net/browse/HSEARCH-4348 to be accepted and released to allow binding with traits

@olliefreeman
Copy link
Contributor Author

my branch is now migrated apart from the documentation.
There are a few features which are not compatible at all however I have tried to accomadate as much as possible.
The documentation will provide all this informaiton

@mtgleeson
Copy link

mtgleeson commented Dec 27, 2021

Hi @olliefreeman
It seems like your branch is the only effort to get this plugin upgraded to be compatible with Grails 5 (?).
Just checking if you submitted a PR? And has your branch (ver 3.0.0?) been published and available on a Maven repo to use?
I don't see it in https://repo.grails.org/ui/native/core/org/grails/plugins/hibernate-search and https://grails.jfrog.io/ui/native/core/org/grails/plugins/hibernate-search

@mtgleeson
Copy link

Hi @olliefreeman
First off, thanks for the effort you've put in to upgrade the plugin to make it Grails 5 and Hibernate Search 6 compatible.
I forked your branch to make a few changes, see below. Let me know if you want me to create a pull-request. It will be great if we can publish an official 3.0.0 version of the plugin to the grails maven repo for others to use. https://github.com/mtgleeson/grails-hibernate-search-plugin/tree/feature/update-to-hibernate-search-6

  • update hibernate plugin to use hibernate5:7.2.0
  • update hibernate to use 5.6.3.Final
  • update hibernate search mapper orm to use 6.1.0.Beta1 (this version contains a fix for the bug you raised so there's no need to use 6.0.8.OXBRC anymore) https://hibernate.atlassian.net/browse/HSEARCH-4348.
  • configure the search mapper configurer to instantiate a new GrailsHibernateSearchMappingConfigurer instead of looking for a bean (I was getting an error on start-up saying it couldn't find the hibernateSearchMappingConfigurer bean).
  • allow the id field in domain classes to be configured in the search closure.
  • change the id field type away from the keyword field to use a generic field. Id fields are longs which are not compatible with keyword fields.
  • allow domain properties of type BigDecimal and BigInteger to use the ScaledNumberField type with a specified decimal scale instead of using generic field type.
  • fix a bug to allow projections on multi-valued fields for full text queries.
  • I updated the README.md with the above details.

A couple of other notes:

  • I noticed the default directory set in hibernate.search.backend.directory.root (GrailsHibernateSearchMappingConfigurer.configure) was not being picked up as a property in Hibernate Search and it was using its own default path ("."). I didn't get a chance to look into why this wasn't working although I noticed you changed how this was being set to use grailsApplication.config.setAt in a recent commit.
  • I tried defining a normalizer in runtime.groovy as per the README.md but it wasn't being created. I didn't spend much time looking into why but I was able to create a normalizer by implementing LuceneAnalysisConfigurer and configuring
    hibernate.search.backend.analysis.configurer = 'class:com.example.lucene.MyLuceneAnalysisConfigurer'
    I added a note to the README.md for this.

@olliefreeman
Copy link
Contributor Author

@mtgleeson massive apologies for the complete lack of response, but work's been hectic and we;ve been using the system without need to update it much. I am now in the process of actually getting the readme updated and will take into account everything you've mentioned here, and make updates appropriately

As a precursor...this particular branch is designed for grails 4, however we are using it in grails 5. My plan was to release this for grails 4 and then put another release in with the updated dependencies for grails5...but time fell away. Also technically this current version should use the latest 6.0.x version (which yes has the fix required) rather than 6.1.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants