SOLR的XML文档的多租户全文搜索

I have a SaaS web app (multi-tenant) that needs full-text search. The full-text search has to be per-tenant - e.g. we don't want one tenant to be able to pull search results for another tenant's data. This will be for searching text documents.

I can see two ways to implement this in SOLR -

  1. multiple "cores"

  2. separate fields with query attributes

Is there a preferred/recommended way to do multi-tenant full-text search with SOLR?

Advantages/disadvantages of either?

I would go for one-core per tenant approach.

Some Reasons, off the top:

  1. indexing and re-indexing can be isolated.
  2. You could shard cores depending on the tenant load, thus enabling you to scale better for high volume clients. (Possibly work your payment model on this)
  3. Unsubscribing means you would just need to delete/rename cores.
  4. you could enable client specific configuration that requires core reloading without having to disrupt other services.