Hi Alex,
there isn't a single hook to provide Solr integration; but if you're willing to help coding and beta test it we can give this a strong push forward.
I think that there are 3 relatively independent aspects to address, not all are mandatory to get it working, depending on your needs.
- Schema synchronization
From the entity mapping, annotations and configuration properties (for example the chosen analyzers) it should generate a compatible Solr schema.
This should be automated, as it would be tricky to get it right manually, but of course it's totally possible to make a first version in which we expect people to configure Solr "correctly" whatever that means.
- Index updates
This one should be relatively easy as we already did a good deal of abstraction. Technically, one should implement an
Code:
org.hibernate.search.indexes.spi.IndexManager
.
The role of such an implementation is "a way to forward index change elements to an indexing engine", so basically one has to adapt the incoming Hibernate Search operations and transform and forward them to a solrj client, and handle some configuration properties to handle connection to the correct Solr server.
I don't think this is too hard at all, and could be considered optional if you are using Lucene "read only".
- Performing searches / queries
This is a bit harder as the internal component handling queries - the org.hibernate.search.query.engine.spi.HSQuery - would need some refactoring as it's not completely abstracting the notion of IndexReader / IndexSearcher, which are specific of a direct reference to the Lucene engine; of course I'd be glad to help in the area.
For your use case, you could consider this optional I guess if you're fine in running Queries only via the solrj client directly with your application's code, and take advantage of the index updates.
That's all it takes; it would be very cool and I'm glad to help if you want to try it.
Starting point: https://community.jboss.org/wiki/ContributingToHibernateSearch
but feel free to ask! either here, on mailing list or IRC
http://hibernate.org/community/irc.html
On a totally different page, I think Search *could* address your needs without any code changes with this different setup:
- you need a central server which is considered the reference index, the "master" node (like you would with Solr)
- each fat client connects to the master node with either JGroups or the JMS backend, to delegate writes to the master node
- each fat client has a copy of the index which it "downloads" on need using either a network shared filesystem or by using the Infinispan Directory