Hi Arnab,
you're correct, keeping the indexes on NFS can be troublesome.
In Hibernate Search it's currently not possible to customize the IndexDeletionPolicy, but patching the code to do so would not be a hard task, I can give you some pointers and if you can create the patch and include the needed changes to documentation we will include this feature in version 4.0, which is coming very soon (a week or two).
Which version of Hibernate Search are you using? Can you upgrade to 4? I'm asking because I don't think the project lead would be happy to apply such a patch to older branches; new features should come in newer releases.
In practice there is an alternative solution:
Use
filesystem-master and
filesystem-slave (
as described here) in combination with the JMS backend,
as described hereThis approach might be slightly more complex to configure, but has several benefits:
* Just one node writes to the Index, so you don't have lock contention. In you scenario having two nodes writing you might have timeouts; while having a single node writing you can enable the option
exclusive_index_use which improves performance a lot.
* All queries are run from locally stored indexes, and will be much faster too.