Question

We plan to implement sharding for our database and want to provide Solr search for the shards too. (For queries which use "like", "order by", "group by" etc)

Which is the best tool for this kind of design?

I have checked couple of these and I am not able to decide on any one of them.

1) Hibernate Shards - This does not seem to be supported actively although its listed very explicitly on the Hibernate main page.

2) SolrJ - Looks good but how do I convert my QueryDSL queries into Solr Queries?

3) SolrCloud - same problem as SolrJ

4) Hibernate Search - Allows me to use QueryDSL, but that means I have to manage sharding features myself because in this case, Lucene will be used as a library. So every shard will have its own Lucene handle and it will be a pain to make them shard aware manually (for example, to merge "order by" results from several shards. SolrCloud will do this automatically for me I assume).

5) Elasticsearch - Looks very similar to SolrCloud (aka Solr 4.0)

So basically, my question boils down to:

How can I use QueryDSL with some lucene product that supports sharding out of the box. (Note: I am happy with the default sharding strategy offered by SolrCloud or ElasticSearch).

I do not want to write a converter for morphing QueryDSL queries into HTTP get/put requests of SolrCloud/ElasticSearch.

Was it helpful?

Solution

Querydsl has direct support for Lucene and Hibernate Search. For Solr and ElasticSearch you will need to use Solr and ElasticSearch specific query languages.

OTHER TIPS

For the record, Hibernate Search does provide transparent sharding so doing a sort distributed on multiple shards is not a problem.

Happy to report we also support Elasticsearch now:

And Solr will come in future (help welcome!); the idea is to give people flawless integration with Hibernate ORM, a nice and stable API, while the choice of using a Lucene instance locally rather than Solr or Elasticsearch remotely is an orthogonal aspect.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top