简体   繁体   中英

Same Hibernate Search Lucene index for multiple applications

I have a database which is being used by two applications Appl 1 and Appl 2 .Both the applications perform Read/Write/Update on the DB.

I am using hibernate search for Indexing my search.

My problem is as follows :

  1. Both Appl1 and Appl2 reside on different servers and hence maintain there own copy of the index,on their local file system.
  2. Now because of this if Appl1 does any update/delete operation Appl2 does not reflect the changes and vice-versa.

Is there any way that both application indexes get updated,when either one of them performs any operation,or i can create a common index directory that is used by both the applications.

Have a look at master/slave setup in the Hibernate Search documentation. The idea is that all updates are sent to a master index which applies them, while the slaves just handle search request using a local index which gets regularly synced with the master index.

Alternatively, you could look at the Infinispan based directory provider. Again look at the online docs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM