I am using the NHibernate.Search assembly and am looking for best practices around using this with multiple web servers.
We have plenty of space on our web servers to handle the indexes we are generating, so I am thinking the best route is to have the indexes on each web server. Then the classes that I am indexing, add a version column. My only question is if I do this, will NHibernate.Search be smart enough to pull the latest record and index it if let’s say Web Server A updated the record and Web Server B’s index is out of date?
The other option is to store the indexes on a shared file location and pull from that network resource. This seems like a less-than-ideal solution as it does not allow for great redundancy.
How are others solving this problem with NHibernate.Search and/or Lucene.NET indexes?
The very moment you decided to put your indexes in different machines you introduced the “distributed search” problem. Things like replication, redundancy, management, monitoring, search aggregation become important and interesting problems you need to address.
That said, Solr is one of the recommended solutions to the problem. More over, SolrNet can help you integrate it with Nhibernate.
I’ve used both projects in combination with Nhibernate and it may be a little confusing at the beginning but it pays off later on.
In your case, you could potentially run Solr in your web servers.