We use the Master / Slave approach, which is supported by NHibernate Search and Lucene.net.
Each WebServer has a subordinate copy of the index and does not index.
Each time the web server updates something, it sends a message to the server service (we use Rhino ServiceBus with msmq), which performs indexing (by downloading the updated object and re-indexing it).
Every 10 seconds (we need modern search queries - the usual practice has a 30-minute grace period), the web server checks for new versions of the index and retrieves it if necessary. It works very well, since the changes are incremental, so the attraction of the full index is only required if we are doing optimization or general re-indexing.
If you need a higher speed, you can optimize it using the ram implementation on web servers, but with rather complicated wildcard searches at the 32 MB index, we are still below 10 ms for queries.
Another optimization would be for the web server to perform indexing, but only send an incremental copy to the backend to add to the main index. This would save the database call from the backend service, albeit with a certain degree of complexity, since you need to delve into the bowels of NHibernate Search / Lucene to do this.
source share