Using Lucene to index private data, should I have a separate index for each user or a single index

Posted by Nathan Bayles on Stack Overflow See other posts from Stack Overflow or by Nathan Bayles
Published on 2012-06-22T21:49:45Z Indexed on 2012/06/25 3:16 UTC
Read the original article Hit count: 198

Filed under:
|

I am developing an Azure based website and I want to provide search capabilities using Lucene. (structured json objects would be indexed and stored in Lucene and other content such as Word documents, etc. would be indexed in lucene but stored in blob storage) I want the search to be secure, such that one user would never see a document belonging to another user. I want to allow ad-hoc searches as typed by the user. Lastly, I want to query programmatically to return predefined sets of data, such as "all notes for user X". I think I understand how to add properties to each document to achieve these 3 objectives. (I am listing them here so if anyone is kind enough to answer, they will have better idea of what I am trying to do)

My questions revolve around performance and security.

Can I improve document security by having a separate index for each user, or is including the user's ID as a parameter in each search sufficient?

Can I improve indexing speed and total throughput of the system by having a separate index for each user? My thinking is that having separate indexes would allow me to scale the system by having multiple index writers (perhaps even on different server instances) working at the same time, each on their own index.

Any insight would be greatly appreciated.

Regards,

Nate

© Stack Overflow or respective owner

Related posts about Azure

Related posts about lucene