title: Lucene indexing: shared or isolated by account?
body: <p>I'm evaluating Lucene to implement a global search feature in a SaaS application.</p>
  
  <p>We do not want users to see the content of the other accounts so searches will always be limited by account.</p>
  
  <p>Is it better to have one single index with an account id field or one index per account? What are the advantages and disadvantages of each approach?</p>
  
  <p>My concern is that a global index might affect performance due to the frequent updates.</p>
  
  <p>Thank you.</p>
  
  <p><strong>EDIT</strong></p>
  
  <ul>
  <li>Estimated number of total documents: 500,0000</li>
  <li>Number of accounts: 4000</li>
  <li>Indexable data is never shared between accounts</li>
  <li>Account users might update their indexable data several times a day (not more than 100 in most cases)</li>
  <li>The amount of indexed data tends to be stable after the initial setup process</li>
  <li>We need to store 10-20 fields per document</li>
  </ul>