Elastic search on both hibernate and mongodb domain classes together

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Elastic search on both hibernate and mongodb domain classes together

raghung
I am having domain classes with both hibernate and mongodb mapping. I installed elastic search gorm plugin and mentioned

"elasticSearch.datastoreImpl = 'mongoDatastore'" in Config.groovy.

It works fine with mongodb domain classes. How do I apply elastic search on remaining hibernate domain classes ? If I put searchable = true, it gives error.
Reply | Threaded
Open this post in threaded view
|

Re: Elastic search on both hibernate and mongodb domain classes together

mstein
As far as I know, the ElasticSearch plugin does not support index mirroring for multiple datastore at once, it will only work for the one specified in the "elasticSearch.datastoreImpl" configuration, you should probably submit an feature request on the github project : https://github.com/noamt/elasticsearch-grails-plugin

Maybe you could try to manually declare another listener for hibernate, but I'm not sure this is going to be that simple. But if you want to try, in your grails-app/conf/spring/resources.groovy, declare a new org.grails.plugins.elasticsearch.AuditEventListener for hibernate (considering you've kept "mongoDatastore" for the ES configuration):

            auditListenerHibernate(AuditEventListener, ref("hibernateDatastore")) {
                elasticSearchContextHolder = ref('elasticSearchContextHolder')
                indexRequestQueue = ref('indexRequestQueue')
            }

Just out of curiosity, what kind of errors does it give you when you make a hibernate domain searchable? Is it failing on startup or when you try to index it?