Using sharding with nhibernate.search for partitioning indexes
We are using NHibernate 3.1 and NHibernate.Search on top of Lucene for full-text searches. So far it is working great, but we have some scalability problems:
In our database, we have several different customers' data - each customer must not be able to see each other's data. So far, we have solved it using Filters, but the problem is that our index is growing huge, and we have problems with the pessimistic locking holding up queries.
What we would like to do is partition the index per customer (all entities have a property with this customerId) using the sharding feature of Lucene.
Has anyone tried this in NHibernate Search - is it even possible?
Not sure what your database / session factory setup is like, but you could use a session factory pointing to a different index directory per customer. If you've only got a single DB this could be kind of strange but it should be pretty painless if your approach to supporting multiple customers in 1 database is sound.
If this sounds interesting, take a look at this answer.
链接地址: http://www.djcxy.com/p/41276.html