Question

Any suggestions on using infinispan as a directotry provider for hibernate search on production environment ?

Our production environment cluster has only two servers running which means infinispan has only two nodes in our case ..

So I am in confusion which one to go for either file based or infinispan based indexing ?

Also is it possible using mongodb in this case as a directory provider ?

Has anyone used mongodb + hibernate search in their projects ?

Thanks Suresh

Was it helpful?

Solution

The difference between the two directory providers:

  • file based master/slave
  • Infinispan

Is essentially that the first one is simpler to setup as it doesn't require you to configure Infinispan, but the indexes are synchronized periodically while the second one provides real-time replication.

You can't store an index directly in MongoDB, but Infinispan can be configured to store its data into a CacheStore for persistence (otherwise it's only in memory on each server node). There is one CacheStore implementation - among many others - which can write in MongoDB.

On your second question, to use Hibernate Search with MongoDB: Hibernate Search works with Hibernate based applications, so it works if you use Hibernate OGM to store your entities in MongoDB. Alternatively if you don't want to use the Hibernate programming model, you could use Infinispan directly for the storage of your data too, and have it persist into MongoDB via the cachestore. Infinispan supports Hibernate Search too, it's called Infinispan Query in that case but uses the same annotations.

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